PersistentStoreManagedObjectContext vs mainQueueManagedObjectContext

Good evening!

So, I'm having trouble understanding what the hell happens when I save my data to Core Data. First of all, a quick question:

1) When should I use persistentStoreManagedObjectContext and when should I use mainQueueManagedObjectContext ?! Right now, I always use persistentManagedObjectContext, but I see that calling RestKit "getObjectsPath", the object will have mainQueueObjectContext. Why is this?!

Thanks!

+7
source share
1 answer

persistentStoreManagedObjectContext can be used to populate another other NSManagedObjectContext (for example, for a background thread).

So, if you do not leave the main thread when accessing the object, use mainQueueManagedObjectContext , and you are on a safe site.

+2
source

All Articles