Messages sent to null in Objective-C
![Messages sent to null in Objective-C](https://res.cloudinary.com/audiodog/image/upload/w_640,h_155,c_scale,f_auto,q_auto/v1513806711/images/site/blog_banner_light.png)
Sending messages to a nil object is safe in Objective-C. This is due to the objc runtime that checks the sender exists before code is executed. Good to know - testing for nil before calling messages on objects is not required, resulting in more concise, readable code.
Example
NSButton *button = nil; [button setEnabled:YES]; // will NOT crash or cause an exception [button setAlternateTitle:[button title]]; // will also be ok