• 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: Instantiate NSString from NSURL in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Instantiate NSString from NSURL in Swift


  • Subject: Re: Instantiate NSString from NSURL in Swift
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 23 Feb 2015 19:25:37 +0000

On Feb 23, 2015, at 11:06 , Marco S Hyman <email@hidden> wrote:
>
> 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.

I’m not so sure. a?.b! is (at least informally) ambiguous, for a?.(b!) or (a?.b)!

If the compiler interprets it as the first alternative, then I think you’d get what the OP observed, assuming ‘lowercase’ doesn’t return an optional result.

_______________________________________________

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


  • Follow-Ups:
    • Re: Instantiate NSString from NSURL in Swift
      • From: Marco S Hyman <email@hidden>
References: 
 >Instantiate NSString from NSURL in Swift (From: Juanjo Conti <email@hidden>)
 >Re: Instantiate NSString from NSURL in Swift (From: Kyle Sluder <email@hidden>)
 >Re: Instantiate NSString from NSURL in Swift (From: Marco S Hyman <email@hidden>)

  • Prev by Date: Re: Instantiate NSString from NSURL in Swift
  • Next by Date: Re: Instantiate NSString from NSURL in Swift
  • Previous by thread: Re: Instantiate NSString from NSURL in Swift
  • Next by thread: Re: Instantiate NSString from NSURL in Swift
  • Index(es):
    • Date
    • Thread