> In other languages, like C++, this would crash your program, but in Objective-C, invoking a method on nil returns a zero value. This greatly simplifies expressions, as it obviates the need to check for nil before doing anything:<p><pre><code> // For example, this expression...
if (name != nil && [name isEqualToString:@"Steve"]) { ... }
// ...can be simplified to:
if ([name isEqualToString:@"steve"]) { ... }
</code></pre>
Wow, that is some bad, bad code. Consider this snippet instead:<p><pre><code> if ([name isDifferentFromString:@"bob"]) { ... }</code></pre>