Convert NSString to FSRef
Convert NSString to FSRef
- Subject: Convert NSString to FSRef
- From: "Kevin Dixon" <email@hidden>
- Date: Sat, 15 Mar 2008 15:04:21 -0400 (EDT)
- Importance: Normal
I'm trying to write a method that will convert a NSString containing a
file system URL to an FSRef with the following code
- (FSRef)stringToFSRef: (NSString*)filePath {
FSRef output;
CFStringRef cfFilePath = CFStringCreateWithCString(NULL, [filePath
cString], (CFStringEncoding)8);
CFURLRef url = CFCreateURLWithString(NULL, cfFilePath, NULL);
CFURLGetFSRef(url, &output);
return output;
}
I am getting a warning on the CFCreateURLWithString, saying
"initialization makes pointer from integer without a cast"
I'm not sure what it is referring to. I've tried casting all of the
arguments to their required types, and the warning persists.
Also, is there a better way to accomplish this?
-Kevin
_______________________________________________
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