• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Saving an NSDocument safely
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Saving an NSDocument safely
      • From: Alastair Houghton <email@hidden>
  • Prev by Date: Re: Core Data: case insensitive "equals" predicate strings!?
  • Next by Date: Re: newbie:how to get the frontmost window but a key window
  • Previous by thread: Re: BMP bug in ImageIO?
  • Next by thread: Re: Saving an NSDocument safely
  • Index(es):
    • Date
    • Thread