Re: CFURLWriteDataAndPropertiesToResource as root?
Re: CFURLWriteDataAndPropertiesToResource as root?
- Subject: Re: CFURLWriteDataAndPropertiesToResource as root?
- From: Sean McBride <email@hidden>
- Date: Mon, 08 Aug 2011 18:42:43 -0400
- Organization: Rogue Research Inc.
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.
--
____________________________________________________________
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