• 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: NSString, stringByAppendingPathComponent, and Canonicalization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString, stringByAppendingPathComponent, and Canonicalization


  • Subject: Re: NSString, stringByAppendingPathComponent, and Canonicalization
  • From: Sean McBride <email@hidden>
  • Date: Thu, 07 Apr 2011 17:51:34 -0400
  • Organization: Rogue Research Inc.

On Mon, 4 Apr 2011 22:19:07 -0500, Stephen J. Butler said:

>> I need to accept a filename from the user. Given the user supplied
>> filename, I form a fully qualified name:
>>
>> NSString* pathName = [NSHomeDirectory(),
>> stringByAppendingPathComponent:@"Documents"];
>> NSString* fullPathName = [pathName
> stringByAppendingPathComponent:filename];
>
>First, you should be getting the path to the documents folder via
>NSSearchPathForDirectoriesInDomains():

Even better is not not use NSStrings/paths at all and use NSURLs
instead.  In that case you'd use URLF
orDirectory:inDomain:appropriateForURL:create:error: instead of
NSSearchPathForDirectoriesInDomains().

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


_______________________________________________

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

References: 
 >NSString, stringByAppendingPathComponent, and Canonicalization (From: Jeffrey Walton <email@hidden>)
 >Re: NSString, stringByAppendingPathComponent, and Canonicalization (From: "Stephen J. Butler" <email@hidden>)

  • Prev by Date: Re: How To Increment CALayer Retain Count?
  • Next by Date: Re: How To Increment CALayer Retain Count?
  • Previous by thread: Re: NSString, stringByAppendingPathComponent, and Canonicalization
  • Next by thread: Re: NSString, stringByAppendingPathComponent, and Canonicalization
  • Index(es):
    • Date
    • Thread