Re: CFURLWriteDataAndPropertiesToResource as root?
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