こんにちは、次の機能は私には機能しません。理由がわかりません。
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
// Delete the row from the data source
NSString *selectedCategory = [self.daten objectAtIndex:indexPath.row];
[self.daten removeObjectAtIndex:indexPath.row]; //we assume, that mySourceArray is a NSMutableArray we use as our data source
[self.tableView beginUpdates];
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
[self.tableView endUpdates];
// ...
}
}
私にはセクションがありません...私は常にその例外を受け取ります:
キャッチされなかった例外によるアプリの終了'NSInternalInconsistencyException'、理由:'無効な更新:セクション0の行数が無効です。更新後の既存のセクションに含まれる行数(19)は、それに含まれる行数と同じである必要があります更新前のセクション(19)、そのセクションから挿入または削除された行の数(0が挿入、1が削除)、およびプラスまたはマイナスがそのセクションに出入りした行の数(0が移動、0が移動)アウト)。' *まずスローコールスタック:(0x342692a3 0x33a3b97f 0x3426915d 0x3922e2af 0x36dd5b83 0x5453d 0x36f6b5d9 0x36e8c0ad 0x36e8c05f 0x36e8c03d 0x36e8b8f3 0x36e8c0ad 0x36e8c05f 0x36e8c03d 0x36e8b8f3 0x36e8bde9 0x36db45f9 0x36da1809 0x36da1123 0x34f195a3 0x34f191d3 0x3423e173 0x3423e117 0x3423cf99 0x341afebd 0x341afd49 0x34f182eb 0x36df5301 0x24343 0x38e34b20)のlibc ++ abi.dylib:例外をスロー呼ばTERMINATE