In Xcode 7 GM I started to get this warning:
Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)
I post this answer to tell why should add _Nonnull
or nullable
.
According to this blog: https://developer.apple.com/swift/blog/?id=25
One of the great things about Swift is that it transparently interoperates with Objective-C code, both existing frameworks written in Objective-C and code in your app. However, in Swift there’s a strong distinction between optional and non-optional references, e.g.
NSView
vs.NSView?
, while Objective-C represents boths of these two types asNSView *
. Because the Swift compiler can’t be sure whether a particularNSView *
is optional or not, the type is brought into Swift as an implicitly unwrapped optional,NSView!
.
it's all for Swift.