NSManagedObjectContext
instances are just scratch pads. They both point to the same underlying NSPersistentStoreCoordinator
. Therefore when you call -save:
in one NSManagedObjectContext
then the NSPersistentStoreCoordinator
will get updated and you can retrieve those changes into the other NSManagedObjectContext
.
If your "background" NSManagedObjectContext
is a child of your "main" NSManagedObjectContext
then just calling -save:
on the background NSManagedObjectContext
will cause the main NSManagedObjectContext
to be updated automatically. That is one of the benefits of the parent/child design.
In any case, the NSManagedObjectContext
instances are just temporary until you save. When you save, those changes all go to the same place; the NSPersistentStoreCoordinator
.