1
我一直在尋找的NSFetchedResultsControllerDelegate協議參考和一些示例代碼在線和打電話時已經注意到了兩種不同的實現更新一個UITableViewCell:通過NSFetchedResultsControllerDelegate協議進行單元更新的差異?
- (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;
OR
// TWO
case NSFetchedResultsChangeUpdate:
[self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
break;