Re: Instantiate NSString from NSURL in Swift
Re: Instantiate NSString from NSURL in Swift
- Subject: Re: Instantiate NSString from NSURL in Swift
- From: Kyle Sluder <email@hidden>
- Date: Mon, 23 Feb 2015 10:49:24 -0600
On Mon, Feb 23, 2015, at 08:18 AM, Juanjo Conti wrote:
> Hi!
>
> I'm translating some code from Objective-C to Swift and in the middle of
> that, i found this problem.
>
> theUrl is an instance of NSURL
>
> theUrl.host?.lowercaseString
>
> compiles ok.
>
> But
>
> NSString(string: theUrl.host?.lowercaseString)
> don't. It says "Value of optional type 'String?' no unwrapped; did you
> mean
> to use '!' or '?'?
>
> If I click to add the fix, then it complains again and suggest to delete
> the '!' :)
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/>
If you are able to reproduce this bad diagnostic on Swift 1.2/Xcode 6.3,
file a bug at <http://bugreport.apple.com>.
--Kyle Sluder
_______________________________________________
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