Re: Updating timestamp on save => merge error
Re: Updating timestamp on save => merge error
- Subject: Re: Updating timestamp on save => merge error
- From: Jerry Krinock <email@hidden>
- Date: Wed, 11 Aug 2010 10:18:08 -0700
On 2010 Aug 10, at 21:48, Gideon King wrote:
> I have a managed object I want to update with a "last saved timestamp" on save. I have the update done on the NSPersistentDocument -saveToURL:ofType:forSaveOperation:error: method.
>
> This works fine, except on save as. I know that the save as creates a new document and updates from the managed objects, and then saves, and it seems that there is a managed object context merge happening in there.
>
> In my case, the timestamp has changed, so I get an error message saying that it can't merge the changes.
>
> Is there a way that I can tell that it's in the process of merging changes in the middle of a save as, and therefore not update the timestamp? Or some other method that I can accomplish my goal of having a save timestamp without running into this issue that happens during a Save As operation.
I've probably oversimplified your problem, but it seems that not updating your timestamp in -saveToURL:ofType:forSaveOperation:error: if the forSaveOperation: parameter == NSSaveAsOperation would help. Core Data doesn't do anything until you invoke super in there. And/or as far as "can't merge the changes", you can clear those with -[NSManagedObjectContext setMergePolicy:].
_______________________________________________
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