Iphone 通过NSFetchedResultsControllerDelegate协议进行单元格更新的差异?
我一直在在线查看NSFetchedResultsControllerDelegate协议参考和一些示例代码,并注意到在调用时更新UITableViewCell的两种不同实现:Iphone 通过NSFetchedResultsControllerDelegate协议进行单元格更新的差异?,iphone,objective-c,cocoa-touch,uitableview,Iphone,Objective C,Cocoa Touch,Uitableview,我一直在在线查看NSFetchedResultsControllerDelegate协议参考和一些示例代码,并注意到在调用时更新UITableViewCell的两种不同实现: - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsC
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject
atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type
newIndexPath:(NSIndexPath *)newIndexPath {
有人能解释这两种不同的方法吗
它们是:
// ONE
case NSFetchedResultsChangeUpdate:
[self configureCell:[tableView cellForRowAtIndexPath:indexPath]atIndexPath:indexPath];
break;
或
正如选择器的名称所暗示的那样,在一种情况下,单元格是用自定义方法(不是苹果的API)配置的,并且很可能在重新加载表视图时更新 在两种情况下是
UITableView
方法,其中可以“免费”获得动画效果。如何以及在何处更新单元格?没有密码就说不出来
// TWO
case NSFetchedResultsChangeUpdate:
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
break;