Re: Differences in NSFileWrapper -initSymbolicLinkWithDestination: and -initSymbolicLinkWithDestinationURL:? [SOLVED]
Re: Differences in NSFileWrapper -initSymbolicLinkWithDestination: and -initSymbolicLinkWithDestinationURL:? [SOLVED]
- Subject: Re: Differences in NSFileWrapper -initSymbolicLinkWithDestination: and -initSymbolicLinkWithDestinationURL:? [SOLVED]
- From: Keith Blount <email@hidden>
- Date: Wed, 28 Apr 2010 09:59:05 -0700 (PDT)
Typically, as soon as I posted my question I figured out the answer. So, to answer my own question, the difference between NSFileWrapper's -deprecated -initSymbolicLinkWithDestination: method and its new -initSymbolicLinkWithDestinationURL: method is that the older method automatically sets the preferredFilename and the newer method does not (and the preferredFilename is necessary for the image to be automatically set for the attachment cell). So, whereas on 10.5 and earlier you would write:
NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initSymbolicLinkWithDestination:myPath];
on 10.6 you need to write:
NSFileWrapper *fileWrapper = [[NSFileWrapper alloc] initSymbolicLinkWithDestinationURL:[NSURL fileURLWithPath:myPath]];
[fileWrapper setPreferredFilename:[myPath lastPathComponent]];
Apologies if that was obvious to the rest of the world and his dog, but it had me stumped for a little while there.
All the best,
Keith
_______________________________________________
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