Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on nil, Nil, NULL, NSNull. Parent comment
Of course, there is one place where you have to go the other way: -isNil: does not work, you need to use -isNotNil
Unless you use the runtime's (private) nil-hook:
+(void)setNilHandler { installed=YES; _objc_setNilReceiver([self nsNil]); }
static id idresult( id receiver, SEL selector, ... ) { return nil; } +(BOOL)resolveInstanceMethod:(SEL)selector { class_addMethod(self, selector, (IMP)idresult , "@@:@"); return YES; }
There are no comments on this comment yet.
Of course, there is one place where you have to go the other way: -isNil: does not work, you need to use -isNotNil
Unless you use the runtime's (private) nil-hook:
Then you can send messages to nil and they will be sent to your class. Of course, you want to mimic the nil-eating behavior as much as possible, so: