> On Feb 25, 2016, at 4:02 PM, [email protected] wrote:
>
> With Nullability in this case, you should create a reference and check if it
> is nil before passing it to a method that expects nonnull.
> It's an extra little bit of code but it does exactly what this warning
> expects and is for.
> It's really the right thing to do based on what the API expects.
Often, yes. But there are a number of cases where you already know by other
means that the value is non-null, for example
if (a.count >= 3)
[widgets addObject: a.firstObject]
Testing a.firstObject for nil would be pointless.
This is the equivalent of those times when you use “!” to dereference an
optional in Swift.
—Jens _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com
This email sent to [email protected]