I don't think objc has the equivalent of a null pointer exception. You can freely send messages to a deallocated object. Since ARC, it is rare, at least in my experience, running into any memory related issues with objc.
I don't think objc has the equivalent of a null pointer exception. You can freely send messages to a deallocated object. Since ARC, it is rare, at least in my experience, running into any memory related issues with objc.
You can send messages to `nil`, but the inverse isn't universally true. APIs like
will throw an `NSInvalidArgumentException` if `other` is nil.You can send messages to null, sendings messages to a deallocated pointer is going to be a bad time.
It’s nice not to crash, but unexpected null can still cause bugs in ObjC when the developer isn’t paying attention.
Having done both ObjC with nonnull annotations, and Swift, I agree that it’d be hard to forgo the having first-class support for Optionals