I have an iPhone project where I have a series of Managed Objects in a Managed Object Context within the main application thread. On a separate thread, I import new objects from a webserver into a second Managed Object Context.
If the import goes ok without errors, I save the import context. This triggers contextDidSave from which I call mergeChangesFromContextDidSaveNotification. The two contexts merge ok. So far, so good.
My desired functionality is to have any objects that are in the original MOC but not in the imported MOC to be deleted (the idea is that the user is refreshing the data, and so old data should be deleted), but the merge seems to just combine the 2 MOCs.
Please can you advise if there is a way of managing the merge of the 2 MOCs so that those not in one are deleted in the other?
Thanks,
John