Everything related to the NSManagedObjectContext of NSPrivateQueueConcurrencyType must be wrapped in a performBlock . To get a background fetch where you want to pass the managed objects back to the main queue context, something like this: (note this is for illustrative purposes only):
// assume self.managedObjectContext is a main queue context NSManagedObjectContext *backgroundContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; [backgroundContext performBlock:^{ // do your fetch - eg executeFetchRequest NSManagedObjectID *objID = [someManagedObject objectID]; [self.managedObjectContext performBlock:^{ NSManagedObject *mainManagedObject = [self.managedObjectContext objectWithID:objID]; // do something now with this managed object in the main context }]; }];
source share