I've added -com.apple.CoreData.ConcurrencyDebug 1 flag to my target. The problem is that I have a background block that is running, and crashes when I'm using either NSPrivateQueueConcurrencyType or NSMainQueueConcurrencyType
My Code:
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ NSManagedObjectContext *privateManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; [privateManagedObjectContext setParentContext:_mainContext]; [User fetchUserWithContext:_ privateManagedObjectContext]; }]; I've also tried:
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [User fetchUserWithContext:_mainContext]; }]; In both situations I get:
CoreData`+[NSManagedObjectContext Multithreading_Violation_AllThatIsLeftToUsIsHonor]:
Thanks for your help,