I am using NSFetchedResultsController to manage an implementation of PSTCollectionView with CoreData. When I implement the following method the indexPath & newIndexPath parameters both come through as null
- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath
{
switch (type) {
case NSFetchedResultsChangeInsert:
NSLog(@"%@", indexPath);
NSLog(@"%@", indexPath);
NSLog(@"______");
break;
default:
break;
}
}
I have been bashing my head against a brick wall with this for a few hours so would appreciate any pointers. Could it be something to do with multithreading? I am processing a large JSON file in a background thread on a separate NSManagedObjectContext instance.
Thanks
Because inserts don’t have an [old]indexPath? Check the
newIndexPathargument