• 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: Convert NSString to FSRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert NSString to FSRef


  • Subject: Re: Convert NSString to FSRef
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 16 Mar 2008 08:35:41 -0700


On 15 Mar '08, at 11:49 PM, Stuart Malin wrote:

1: I have never worked with CF functions before

Then, with all due respect, you might want to hold off giving advice to others until you get some more experience with it. CF can be tricky to work with.


(1) Both of your examples leak memory, because you didn't call CFRelease on the CFURLRefs you created.
(2) It would be better to use CFURLCreateWithFileSystemPath to create the URL. It avoids the intermediate conversion of the string to a C string, and it's specialized for working with file paths (which may not be 100% UTF-8.)


—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Convert NSString to FSRef
      • From: Stuart Malin <email@hidden>
References: 
 >Re: Convert NSString to FSRef (From: Stuart Malin <email@hidden>)

  • Prev by Date: Re: Fullscreen NSWindow or NSView?
  • Next by Date: CA: How to wait for an animation to finish?
  • Previous by thread: Re: Convert NSString to FSRef
  • Next by thread: Re: Convert NSString to FSRef
  • Index(es):
    • Date
    • Thread