Re: Saving only required files in a file wrapper?
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