My app sometimes inserts objects into the managed object context that are not meant to necessarily be saved. For example, when I launch an \'add entity\' modal, I create a m
If you use the parent/child pattern, you usually declare the parent context with NSMainQueueConcurrencyType and the child contexts with NSPrivateQueueConcurrencyType. NSConfinementConcurrencyType is used for the classic threading pattern.
If you want to keep the context, you somehow need a strong reference to it.
You simply call the save method on the child context to push the changes to the parent context, if you want to persist the data, you call save on the parent context as well. You dont need to do this within a block.
There are several methods to get an specific object from a context. I cant tell you which one will work in your case, try them out:
- objectRegisteredForID:
- objectWithID:
- existingObjectWithID:error: