• 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: Differences in NSFileWrapper -initSymbolicLinkWithDestination: and -initSymbolicLinkWithDestinationURL:? [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Cocoa Newbie & MySQL
  • Next by Date: Re: UIView, UILabel, and sizeToFit
  • Previous by thread: Re: UIView, UILabel, and sizeToFit
  • Next by thread: Getting filename in NSDocument readFromData
  • Index(es):
    • Date
    • Thread