私はアプリにいくつかのUITableViewを持っていて、削除するためにスワイプがうまくいっています。クラッシュ時にスワイプして削除する
*** 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
でなければならないのは何のコード私は、コードを追加しましたが、それは呼ばれていますアプリがクラッシュする前に。 – Echilon
どのメソッドも呼び出されていない場合は、デリゲートが正しく設定されていますか? – Darren