logoalt Hacker News

tarentelyesterday at 4:20 PM3 repliesview on HN

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.


Replies

favoritedtoday at 12:20 AM

You can send messages to `nil`, but the inverse isn't universally true. APIs like

  [text stringByAppendingString:other]; 
will throw an `NSInvalidArgumentException` if `other` is nil.
Me1000yesterday at 4:42 PM

You can send messages to null, sendings messages to a deallocated pointer is going to be a bad time.

show 1 reply