Created
July 6, 2011 21:28
-
-
Save mysteriouspants/1068374 to your computer and use it in GitHub Desktop.
Runtime Funs!
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
// compile with: | |
// clang -framework Foundation test.m | |
// run with: | |
// ./a.out | |
#import <objc/runtime.h> | |
#import <Foundation/Foundation.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
struct objc_method_description m = | |
protocol_getMethodDescription(@protocol(NSCoding), @selector(encodeWithCoder:), YES, YES); | |
printf("s: %s \n", @selector(foobar:)); | |
printf("m: %s, %s \n", m.name, m.types); | |
[pool release]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment