Getting warning when saving merged MOC
Getting warning when saving merged MOC
- Subject: Getting warning when saving merged MOC
- From: Rick Mann <email@hidden>
- Date: Mon, 4 Jan 2010 23:35:54 -0800
I'm slowly but surely getting the hang of using multiple MOCs. I'm successfully creating objects in MOC B and merging those changes into the existing MOC A, and seeing the UI bound to MOC A update to reflect the changes.
The problem I'm seeing now is that MOC A then becomes dirty, and wants to be saved. If I save it, I get a warning that "This document’s file has been changed by another application since you opened or saved it. The changes made by the other application will be lost if you save. Save anyway?"
The thing that's a bit wonky here is that these changes are already saved in the store, because that's how the MOCs got merged in the first place (the dirty flag is being set by my call to -mergeChangesFromContextDidSaveNotification:). There's definitely no other app involved.
The changes in MOC B consist of all new objects, and a relationship between an old object and a new one. This is a to-many relationship, that is, the old Group entity picks up another Part entity.
Am I doing something wrong, or failing to take some step to avoid this confusion? There may be legitimate changes in MOC A that need to be saved, but the merged changes should already be in the store.
TIA,
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden