我有一個應用程序中的幾個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