Skip navigation.
 
mlConvert NSString to FSRef
FROM : Kevin Dixon
DATE : Sat Mar 15 20:04:21 2008

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

Related mailsAuthorDate
mlConvert NSString to FSRef Kevin Dixon Mar 15, 20:04
mlRe: Convert NSString to FSRef Adam R. Maxwell Mar 15, 20:23
mlRe: Convert NSString to FSRef Jean-Daniel Dupas Mar 15, 20:25
mlRe: Convert NSString to FSRef Keith Duncan Mar 15, 20:34
mlRe: Convert NSString to FSRef Adam R. Maxwell Mar 15, 20:48
mlRe: Convert NSString to FSRef Stuart Malin Mar 16, 07:49
mlRe: Convert NSString to FSRef stephen joseph but… Mar 16, 09:11
mlRe: Convert NSString to FSRef Nir Soffer Mar 16, 10:41
mlRe: Convert NSString to FSRef Jean-Daniel Dupas Mar 16, 12:09
mlRe: Convert NSString to FSRef Jens Alfke Mar 16, 16:35
mlRe: Convert NSString to FSRef Stuart Malin Mar 16, 18:09
mlRe: Convert NSString to FSRef Michael Ash Mar 16, 19:15
mlRe: Convert NSString to FSRef Adam R. Maxwell Mar 16, 19:38
mlRe: Convert NSString to FSRef Kevin Dixon Mar 17, 16:44
mlRe: Convert NSString to FSRef Sean McBride Mar 17, 17:27