Re: Implicitly unwrapped optionals
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