我正在使用SWRevealViewController用于侧面菜单。加载的UIViewController包含一个UITableView。表格视图有滑动删除启用。但是,编辑功能始终不起作用。即tableView:commitEditingStyle:不会被解雇。虽然它发生了几次尝试。我认为手势识别器存在冲突。已经有一天了。有人可以帮助我吗?幻灯片删除UITableViewCell不能正常工作
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
NSUInteger count = [self.shopListArray count];
if (row < count) {
[[[self.shopListArray objectAtIndex:indexPath.section] objectForKey:IFRecipe_ingredient] removeObjectAtIndex:row];
}
[self.shopListTableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
手势发生冲突时该怎么办?
用相关代码更新您的问题。 – rmaddy 2014-12-19 04:40:11
我很确定SWRevealViewController不会工作,UISlider也会:) – arturdev 2014-12-19 11:40:50