我有一个应用程序中的几个UITableViews和刷卡删除工作正常所有人。问题是,当我尝试扫过空单元格(底部),应用程序只是崩溃与:滑动时滑动删除
*** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit/UIKit-1914.84/UITableView.m:833
2012-03-24 16:20:03.158 [22339:707] Exception - attempt to delete row 3 from section 0 which only contains 3 rows before the update - attempt to delete row 3 from section 0 which only contains 3 rows before the update
无论cellForRowAtIndexPath, commitEditingStyle
也不editingStyleForRowAtIndexPath
在飞机坠毁前被调用时,它就像在飞机坠毁前的任何情况我的方法有机会被调用。
仅供参考,我有这样的editingStyleForRowAtIndexPath
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
if ((indexPath.row == self.insertIndex && indexPath.section == [self.sections count] -1) || (indexPath.row == 0 && [sections count]==0)) { // last row of section, or only row of only section
return UITableViewCellEditingStyleInsert;
} else {
return UITableViewCellEditingStyleDelete;
}
}
UPDATE:这实际上是一个巨大的问题,因为该应用程序时几乎不可用的实现代码如下滚动。
什么代码,你已经在editingStyleForRowAtIndexPath – Darren 2012-03-24 16:35:34
我已经添加了代码,但应用程序崩溃之前。 – Echilon 2012-03-24 17:00:26
如果没有任何方法正在调用,您是否正确设置了委托? – Darren 2012-03-24 17:16:43