I'm one of the many getting the following Core Data error (133000
):
Object's persistent store is not reachable from this NSManagedObjectContext's coordinator
As I've seen all over SO, this is because of Core Data's threading restrictions.
However, I've complied to all the correct threading restrictions, and yet this error is still coming through.
I create an NSManagedObject using the below code to perform the function on the main thread:
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self
selector:@selector(commitPlayer:)
object:message];
[[NSOperationQueue mainQueue] addOperation:operation];
[operation release];
This function then creates the object and it's perfectly happy.
Then attempting to fetch the object with [objectContext existingObjectWithID:objectID error:&error]
returns nil with the aforementioned error.
I've also wrapped the object fetching with an @synchonized mutex lock block just in case, and yet it is still failing to fetch that object.
It appears that saving the context before hand fixes this, however I want to fetch the object regardless as to whether it's saved or not as the DB shouldn't be saved at this point.