Re: API Path Question
Re: API Path Question
- Subject: Re: API Path Question
- From: Jerrod Fowkes <email@hidden>
- Date: Mon, 12 Jun 2006 12:08:11 -0700 (PDT)
Nick Zitzmann <email@hidden> wrote: > NSString* theURL = @"/Users/useronfilesystem/documents/u i.yui";
> CFStringRef escapedURL = nil;
> escapedURL = CFURLCreateStringByAddingPercentEscapes
> (kCFAllocatorDefault,
> (CFStringRef)theURL, NULL, NULL, kCFStringEncodingUTF8);
>
> CFURLRef anURL = nil;
> anURL = CFURLCreateWithString(NULL, escapedURL, NULL);
> CFStringRef filePath = nil;
> filePath = CFURLCopyFileSystemPath(anURL, kCFURLHFSPathStyle);
I think you're making this too difficult. Try something like this
instead:
NSURL *theURL = [NSURL fileURLWithPath:@"/Users/useronfilesystem/
documents/u i.yui"];
NSString *filePath = (NSString *)CFURLCopyFileSystemPath((CFURLRef)
theURL, kCFURLHFSPathStyle);
// do stuff here...
[filePath release];
Nick Zitzmann
Yup, that works every bit as well. Less code too. I probably implemented what fileURLWithPath does :-P Thank you, and it appears that I have quite a bit to learn as far as what is available to me in this particular API. -Jerrod Fowkes
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden