且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NSFetchedResultsController:删除1行会导致应用程序崩溃

更新时间:2023-12-03 14:20:04

p>

Don't call

[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];

只能使用

[self.managedObjectContext deleteObject:sd];

获取的结果控制器委托方法 didChangeObject: $ c>

注意,你不需要 beginUpdates / endUpdates 这里。

Note that you don't need beginUpdates/endUpdates here.