My app uses Core Data (with some help of Magical Record) and is rather heavily multithreaded using NSOperation
.
Of course I am very careful to only pass aro
The problem is that NSManagedObjectID
you pass is temporary. You can check it by calling NSManagedObjectID
's isTemporaryID
method. From docs:
Returns a Boolean value that indicates whether the receiver is temporary.
Most object IDs return NO. New objects inserted into a managed object context are assigned a temporary ID which is replaced with a permanent one once the object gets saved to a persistent store.
You should first save your changes to persistent store, only then get a permanent ID to pass to other context.