Re: Why is NSString->FSRef so hard?
Re: Why is NSString->FSRef so hard?
- Subject: Re: Why is NSString->FSRef so hard?
- From: Jim Correia <email@hidden>
- Date: Thu, 30 Apr 2009 01:11:34 -0400
On Thu, Apr 30, 2009 at 12:02 AM, Charles Srstka
<email@hidden> wrote:
> With that said, I don't really see what is harmful about recommending the
> use of NSString's path concatenation methods, which could save quite a few
> headaches in the case that this *does* somehow change for some bizarre
> reason, however unlikely that may be.
Even if the path separator never changes, they are still beneficial to
use because they automatically handle both the trailing slash present
and trailing slash missing cases transparently
[@"/foo" stringByAppendingPathComponent: @"bar"] -> /foo/bar
[@"/foo/" stringByAppendingPathComponent: @"bar"] -> /foo/bar
- Jim
_______________________________________________
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