I occasionally get this error when saving to core data. I cannot manage to recreate it.
Does anyone have any experience with this error;
CoreData: er
This happens when the object's context does not belong to the current thread. One of many ways that mistake can manifest itself.
When the crash occurs do the following:
NSManagedObjectContext
mainQueueConcurrencyType
then it needs to be on the main thread otherwise on the background threads.p context.concurrencyType
In the sample command above the NSManagedObjectContext
was stored in the variable context
(NSManagedObjectContextConcurrencyType) $R4 = mainQueueConcurrencyType
I found the same problem when I tried to read (access) data from a Coredata Store in other thread (not main).
You can solve this problem by following this suggestion from this link:
Core Data and threads / Grand Central Dispatch
After going to several post, this had a better answer https://web.archive.org/web/20150215081345/http://www.cocoabuilder.com:80/archive/cocoa/311615-weird-core-data-crash.html