• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Convert NSString to FSRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Convert NSString to FSRef
      • From: "Sean McBride" <email@hidden>
    • Re: Convert NSString to FSRef
      • From: "stephen joseph butler" <email@hidden>
    • Re: Convert NSString to FSRef
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: Convert NSString to FSRef
      • From: "Adam R. Maxwell" <email@hidden>
  • Prev by Date: [OT?] WWDC
  • Next by Date: Re: XCode3 & NSLog & Tiger compatibility
  • Previous by thread: [OT?] WWDC
  • Next by thread: Re: Convert NSString to FSRef
  • Index(es):
    • Date
    • Thread