• 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: Implicitly unwrapped optionals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implicitly unwrapped optionals


  • Subject: Re: Implicitly unwrapped optionals
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 14 Jun 2014 13:44:43 -0700

On Jun 14, 2014, at 13:09 , Ken Thomases <email@hidden> wrote:

> For convenience.

Specifically, IIUC, the point is that NSDate? and NSDate are different, incompatible types. The convenience comes from not having to “cast” NSDate? to NSDate by using the “!” operation in expressions.

On Jun 14, 2014, at 12:45 , Roland King <email@hidden> wrote:

> Finally if you have an implicitly optional Bool, bbb, what does
>
> if bbb
>
> do?


Did you mean “implicitly unwrapped”? Then, by the above logic, the type of the ‘if’ expression is Bool, so it would crash if ‘bbb’ is nil. Otherwise, it would test the boolean value of ‘bbb’.

IIUC

_______________________________________________

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: Implicitly unwrapped optionals
      • From: Vincent <email@hidden>
References: 
 >Implicitly unwrapped optionals (From: Roland King <email@hidden>)
 >Re: Implicitly unwrapped optionals (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: NSOutlineView floating group row question
  • Next by Date: Re: NSOutlineView floating group row question
  • Previous by thread: Re: Implicitly unwrapped optionals
  • Next by thread: Re: Implicitly unwrapped optionals
  • Index(es):
    • Date
    • Thread