Enumeration values 'NSFetchedResultsChangeMove' and 'NSFetchedResultsChangeUpdate' not handled in switch
という警告が出た時。
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id <NSFetchedResultsSectionInfo>)sectionInfo
atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
{
switch(type) {
case NSFetchedResultsChangeInsert:
[self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
break;
case NSFetchedResultsChangeDelete:
[self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
break;
}
}
上記のメソッドは、InsertとDeleteについては書いてあるのですが、MoveとUpdateについてはなにも書かれていないために警告が出ています。
なので、なんでもいいので追記します。
case NSFetchedResultsChangeMove:
NSLog(@"A table item was moved");
reak;
case NSFetchedResultsChangeUpdate:
NSLog(@"A table item was updated");
break;
これでOK。