• 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
Re: Saving only required files in a file wrapper?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Saving only required files in a file wrapper?


  • Subject: Re: Saving only required files in a file wrapper?
  • From: Graham Cox <email@hidden>
  • Date: Thu, 8 May 2008 12:06:00 +1000


On 8 May 2008, at 10:26 am, Keith Blount wrote:

The trouble with all of these methods is that they tell you not to rely on fileURL


My interpretation of that advice is that at the time the read... and write... methods are called, the document hasn't set up -fileURL, so in that sense you can't rely on it (i.e. don't call -fileURL from within these methods). But the URL passed to the methods themselves as a parameter is definitely reliable. So provided you use the parameter you'll be fine. If you call other parts of your code that need the URL from inside these methods, you also need to pass them the URL directly, don't let them fetch it using -fileURL.

A potential issue is if your users use Save As.. to save to a completely new file. In that case there is:

writeToURL:ofType:forSaveOperation:originalContentsURL:error:

so you have the original file URL as well so you can copy across other parts of the package to the new file. Again, there's no need to call - fileURL at that time, which may or may not refer to the original file.

hth,

G.
_______________________________________________

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 only required files in a file wrapper?
      • From: Ken Thomases <email@hidden>
References: 
 >Re: Saving only required files in a file wrapper? (From: Keith Blount <email@hidden>)

  • Prev by Date: Palette a NSStepper with tow Buttons and a NSTextField
  • Next by Date: Re: find repaint areas?
  • Previous by thread: Re: Saving only required files in a file wrapper?
  • Next by thread: Re: Saving only required files in a file wrapper?
  • Index(es):
    • Date
    • Thread