Uitableview 滑动以删除不存在的内容';我不能在iPad上工作

Uitableview 滑动以删除不存在的内容';我不能在iPad上工作,uitableview,ios6,swipe,Uitableview,Ios6,Swipe,我有一个自定义单元格的UITableView,在iPad模拟器中可以滑动删除,但在iPad设备上从来都不起作用 这是我的密码: - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editi

我有一个自定义单元格的UITableView,在iPad模拟器中可以滑动删除,但在iPad设备上从来都不起作用

这是我的密码:

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
        return YES;
}

- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
        return UITableViewCellEditingStyleDelete;
}

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView beginUpdates];
    if (editingStyle == UITableViewCellEditingStyleDelete)
    {
        if(_itemsArray == nil)
            NSLog(@"\n\nNIL ARRAY\n\n");
        NSLog(@"\nindexPath.row = %d\nItemsArray Count:%d",indexPath.row,_itemsArray.count);
        int row = [[[_itemsArray objectAtIndex:indexPath.row]valueForKey:@"itemRow"] integerValue];
        [_itemsArray removeObjectAtIndex:indexPath.row];
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
        [[self delegate]didDeletedBillItemRow:row];
    }
    [tableView endUpdates];
}
我还在自定义单元控制器中实现了LayoutSubView:

-(void)layoutSubviews
{
    [super layoutSubviews];
} 

你认为问题出在哪里?

可能对你有用,也可能不适用。我花了一段时间弄明白为什么它对我不起作用。我意识到这是因为手机用户交互功能关闭了。我不知道为什么它还在模拟器上工作,但这为我修复了它。

我只是将编辑期间选择模式的属性更改为“编辑期间的单个选择”,而不是“编辑期间的多个选择”现在,我可以使用“滑动删除”完美地删除行。

我建议在实际设备上调试代码,这有时可能会给您更好的提示。正如你所说,它在模拟器中工作。谢谢你的回答,我已经做到了,问题是iPad无法识别桌面上的任何滑动,我检查了userInteractionEnabled,是的,这太奇怪了。我还将滑动手势识别器添加到另一个表中,而且在实际设备中无法识别!但在模拟器上运行良好。