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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to