Get Updates By E-mail 

Article Written By:
Johann Dowa

Tutorial: The Differences Between Objective-C NULL, nil, Nil and NSNull Explained

Understanding and working with the different ways to represent nothingness in Objective-C (Null, nil, Nil, l, NSNull) can be extremely confusing and can lead to bugs and wasted time.

Previously I mentioned a project providing an NSObject that causes NSNull to  return nil in many cases where NSNull would cause an exception to be thrown which can help cut down on the number of if statements required to validate objects.

Matt Thompson has written a great guide explaining the differences between each of these different representations that should prove very helpful in avoiding any complications that can arise.

You can find the guide on the NSHipster site here.

A nice straightforward explanation of one of those potentially annoying Objective-C idiosyncrasies.

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.