Saving an NSDocument safely
Saving an NSDocument safely
- Subject: Saving an NSDocument safely
- From: Thomas Thiriez <email@hidden>
- Date: Fri, 11 Jan 2008 11:47:03 +0100
Hello,
I have an NSDocument, and in order to save it, I override the method:
-saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:
In order not to lose the original file until I am sure saving was
completed properly, I save in a temporary file, and when this is done,
I delete the original file, and rename my temporary file.
While this work fine in 10.4, with 10.5, the next time I try saving
the file, I get the message 'The location of the document "mydoc"
cannot be determined'.
It seems that the NSDocument is confused by the fact that the file has
diasppeared, even though a new one has taken its place.
Is there a way to tell the NSDocument that the new file is really the
one that was saved? Otherwise, is there another way to make sure the
file was saved properly before losing the original one?
Thanks,
Thomas
_______________________________________________
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