> On Aug 13, 2015, at 3:08 PM, Quincey Morris 
> <[email protected]> wrote:
> 
> On Aug 13, 2015, at 12:56 , Rick Mann <[email protected] 
> <mailto:[email protected]>> wrote:
>> 
>> Now I have to write:
>> 
>> let s2 = ((s as NSString).stringByExpandingTildeInPath as 
>> NSString).stringByAppendingPathComponent("foo")
>> 
>> How is this better?
> 
> What happened is that the methods in NSPathUtilities.h are no longer 
> available to the String type. It’s unknown whether this was an oversight, or 
> if there’s a philosophical reason for the change. I guess we’ll find out in 
> the next beta.

I think there’s pretty good odds for it being philosophical, since they added a 
whole new warning for it telling you to cast it to NSString.

> In the meantime, casting to NSString is a slight inconvenience, or you can 
> use NSURL (though Charles Strska has pointed out that you need to be careful 
> when appending a path extension to a NSURL).

Hey, I’m famous! But yeah, my guess is that this is intended to coax people who 
are still using string paths to refer to files to quit doing that (although 
there are some times when you’re just dealing with a filename and not a whole 
path, and NSURL won’t do the job, and then there’s really no alternative but 
the ugly cast).

Charles

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to