Re: Instantiate NSString from NSURL in Swift
Re: Instantiate NSString from NSURL in Swift
- Subject: Re: Instantiate NSString from NSURL in Swift
- From: Marco S Hyman <email@hidden>
- Date: Mon, 23 Feb 2015 11:06:07 -0800
> First, try it on Swift 1.2, which is currently available as part of the
> Xcode 6.3 beta: <https://developer.apple.com/xcode/downloads/>
I'll save him the trouble (because I was curious). In a 1.2 playground...
let theUrl = NSURL(string: "file://Some.Host/something.txt")
let foo = theUrl?.host?.lowercaseString
let bar = NSString(string: foo!)
let baz = NSString(string: theUrl?.host?.lowercaseString!)
You'd think baz would be the same as bar. Instead it generates the error
he is seeing.
> If you are able to reproduce this bad diagnostic on Swift 1.2/Xcode 6.3,
> file a bug at <http://bugreport.apple.com>.
Yup, he should do that.
Marc
_______________________________________________
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