Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Dump all selectors from a class.
- (void)dumpAllSelector:(Class) SomeClass
id t = [[SomeClass alloc] init];
int i=0;
unsigned int mc = 0;
Method * mlist = class_copyMethodList(object_getClass(t), &mc);
NSLog(@"%d methods", mc);
NSLog(@"Method no #%d: %s", i, sel_getName(method_getName(mlist[i])));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment