Convert from Null Object to Nonzero (Objective-C)

I am using the new nullability value in Xcode 6.3

However, I encountered such a problem

[Object doSomethingWithNonNullParam:otherObject.nullableProperty];

What is the best way to solve this problem if I'm sure otherObject.nullablePropertynot nil?

+4
source share
1 answer

I think a cast is appropriate here?

[Object doSomethingWithNonNullParam:(OtherObject *_Nonnull) otherObject.nullableProperty];

+6
source

All Articles