• 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
Re: C: treated as a path component
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C: treated as a path component


  • Subject: Re: C: treated as a path component
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Wed, 15 Apr 2009 22:34:34 +0200


Le 15 avr. 09 à 01:57, Dragan Milić a écrit :

Hell all,

Let's suppose I've got NSString @"C:omponent" , which represents the name of a file. Is there a way to instruct NSString class not to treat a leading single letter followed by a column as a path separator? Namely, I need this one treated as only one path component @"C:omponent", but NSString sees two, @"C:" and "omponent". So, if I ask for the last path component, I get @"omponent" instead of the whole string @"C:omponent".

I've searched documentation, took a look into NSPathUtilities.h, but no help.


You can use the CFURL API which provide a set of function to manipulate path, but due to memory management, it's not as clean than the Cocoa string API (objects are not autoreleased).

	• CFURLCreateCopyAppendingPathComponent
	• CFURLCreateCopyAppendingPathExtension
	• CFURLCreateCopyDeletingLastPathComponent
	• CFURLCreateCopyDeletingPathExtension

CFURLCopyPathExtension
CFURLCopyLastPathComponent

etc…
_______________________________________________

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: C: treated as a path component
      • From: Steve Christensen <email@hidden>
References: 
 >C: treated as a path component (From: Dragan Milić <email@hidden>)

  • Prev by Date: Re: 3 iPhone SDK Questions
  • Next by Date: Re: Master-detail interface, multiple selection, and mixed state checkbox state transitions
  • Previous by thread: Re: C: treated as a path component
  • Next by thread: Re: C: treated as a path component
  • Index(es):
    • Date
    • Thread