Re: Updating timestamp on save => merge error
Re: Updating timestamp on save => merge error
- Subject: Re: Updating timestamp on save => merge error
- From: Gideon King <email@hidden>
- Date: Thu, 12 Aug 2010 07:38:33 +1000
Thanks Jerry
Yes, those are the things I had thought of - unfortunately the save type comes across as Save As for the first save too, and also I really should be setting it for a Save As anyway. I could get around it by using the merge policy, but that may well hide some other, real issues. It may be my best option though.
I'm surprised nobody else appears to have faced this problem, or even chimed in to say that they were setting a timestamp and didn't have the problem, in which case I would go looking elsewhere for the real cause, but from what I can see at the moment, it really does look like a simple case of "you can't set a value between the saveDocument: and the actual saving of the document, without it giving the merge error".
Yes, I have tried moving the update right up to the saveDocument: and saveDocumentAs:, and I have another attribute that gets updated called saveCount, and if I only update that attribute, I still get the merge error, but if I update neither, then the Save As works fine. So I'm pretty sure I have narrowed it down to that one thing.
So I guess I'll just have to bite the bullet and change the merge policy.
Thanks again
>
> 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