チェックアウトするための簡単なサンプルコードを次に示します: iPhoneCoreDataRecipes
トピックについては、提供されている最も優れたメソッドの 1 つを次に示します。
// If I want to delete the next 3 cells after the one you click
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSMutableArray* indexPaths = [NSMutableArray array];
for (int i = indexPath.row + 1; i < indexPath.row + 4; i++)
{
[indexPaths addObject:[NSIndexPath indexPathForRow:i inSection:0]];
}
[tableView beginUpdates];
[tableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade];
[tableView endUpdates];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
この問題に遭遇しました。正しく理解していれば、更新してもセルが削除されないということです。したがって、それらを削除してから更新を呼び出してください。幸運を!