Re: Getting warning when saving merged MOC
Re: Getting warning when saving merged MOC
- Subject: Re: Getting warning when saving merged MOC
- From: Rick Mann <email@hidden>
- Date: Tue, 5 Jan 2010 00:54:51 -0800
On Jan 5, 2010, at 00:07:55, Rob Keniger wrote:
>
> On 05/01/2010, at 5:35 PM, Rick Mann wrote:
>
>> 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.
>
>
> When doing things like this that you don't want the undo manager to pick up on, you just need to disable undo while you perform the operation, making sure you flush changes before re-enabling it:
>
> [moc processPendingChanges];
> [[moc undoManager] disableUndoRegistration];
>
> //do some stuff that alters the moc
>
> [moc processPendingChanges];
> [[moc undoManager] enableUndoRegistration];
Well, bracketing the merge call with that prevents the first MOC from showing as dirty, but if I make a subsequent change to it, and then try to save, I still get that warning that another app has modified the data, and those changes will be lost if I continue.
_______________________________________________
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