• 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: CFURLWriteDataAndPropertiesToResource as root?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFURLWriteDataAndPropertiesToResource as root?


  • Subject: Re: CFURLWriteDataAndPropertiesToResource as root?
  • From: Stephen Blinkhorn <email@hidden>
  • Date: Mon, 08 Aug 2011 19:35:10 -0600

On 8 Aug 2011, at 16:42, Sean McBride wrote:

On Mon, 8 Aug 2011 16:13:50 -0600, Stephen Blinkhorn said:

To be clear, you'd need to use ~/Library/App Support not the one in /
Library.

OK, no problem in Cocoa with the stringByExpandingTildeInPath: method of NSString. More problematic for CFStringRef though. Is there an acknowledged way of doing the equivalent with CFStringRefs? I appreciate this is nolonger a Cocoa issue.

Actually, don't use stringByExpandingTildeInPath:. Paths are deprecated, you should use NSURL or CFURL to reference file system objects. Instead, do something like this:


NSFileManager* fileManager = [[NSFileManager alloc] init];
NSError* error = nil;
NSURL* url = [fileManager URLForDirectory:NSApplicationSupportDirectory
inDomain:NSUserDomainMask
appropriateForURL:nil
create:YES
error:&error];


Not sure about at the CF level... you could use FSFindFolder() I guess.

[fileManager URLForDirectory:..] is 10.6+ only and since I'm supporting 10.4 through 10.7 I'm using FSFindFolder() for now and it's all working, even on Lion!


Thanks,
Stephen




-- ____________________________________________________________ Sean McBride, B. Eng email@hidden Rogue Research www.rogue-research.com Mac Software Developer Montréal, Québec, Canada



_______________________________________________

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


References: 
 >CFURLWriteDataAndPropertiesToResource as root? (From: Stephen Blinkhorn <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Kyle Sluder <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Stephen Blinkhorn <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Eli Bach <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Sean McBride <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Stephen Blinkhorn <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Kyle Sluder <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Stephen Blinkhorn <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Quincey Morris <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Stephen Blinkhorn <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Sean McBride <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Stephen Blinkhorn <email@hidden>)
 >Re: CFURLWriteDataAndPropertiesToResource as root? (From: Sean McBride <email@hidden>)

  • Prev by Date: Re: Decimation - NSBezierPath or something else?
  • Next by Date: Scaling the scroll wheel
  • Previous by thread: Re: CFURLWriteDataAndPropertiesToResource as root?
  • Next by thread: Re: CFURLWriteDataAndPropertiesToResource as root?
  • Index(es):
    • Date
    • Thread