Created
April 30, 2013 20:38
-
-
Save smirn0v/5491758 to your computer and use it in GitHub Desktop.
alternative nil receiver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Foundation/Foundation.h> | |
| extern id _objc_setNilReceiver(id newNilReceiver); | |
| @interface Foo:NSObject{} | |
| @end | |
| @implementation Foo | |
| - (void) some { | |
| NSLog(@"Some"); | |
| } | |
| @end | |
| int main() { | |
| @autoreleasepool { | |
| Foo* test = [Foo new]; | |
| _objc_setNilReceiver(test); | |
| [(id)nil some]; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment