I am using the performBlock: and performBlockAndWait: methods to execute fetch requests on my context on a read only database (it is packaged with my app so never written to).
Am I supposed to be wrapping every NSManagedObject accessor inside performBlockAndWait: as well? - that'd be pretty messy. I'm currently getting crashes whenever CoreData is faulting a one-to-many relationship while CoreData's private queue is doing an execute with performBlock:
Something like:
NSManagedObject* alreadyFetchedObject = ...;
NSArray* alreadyFetchedObject.otherObjects; // Crashes here on main thread (no performBlock wrapped around accessing otherObjects)
.
[context performBlockAndWait:^{
// Currently executing here on CoreData's own queue
result = [context executeFetchRequest:fetchRequest error:nil];
}];