In Objective-C it's safe to send message to nil - no runtime error, just some default behavior.
NSIndexPath * path = [table indexPathForSelectedRow];
NSLog(@"path ref: %d, path %@", [path retainCount], path);
When path is nil, [path retainCount] will return 0 instead of triggering an error.
No comments:
Post a Comment