コードNSFetchedResultsController
が次のようにデリゲートを に割り当てる場合:
-(id)initWithFetchedResultsController:(NSFetchedResultsController*)fetchedResultsController
{
self = [super init];
if (self != nil)
{
fetchedResultsController.delegate = self;
_fetchedResultController = fetchedResultsController;
}
return self;
}
NSFetchedResultsControllerDelegate
メソッドが呼び出されること– controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:
はありませんself
:
-(void)controller:(NSFetchedResultsController *)controller
didChangeObject:(id)anObject
atIndexPath:(NSIndexPath *)indexPath
forChangeType:(NSFetchedResultsChangeType)type
newIndexPath:(NSIndexPath *)newIndexPath
{
NSLog(@"Delegate method called"); // Never called
}
述語に問題はなく、述語が割り当てられ、通知の操作が直接機能します。