Skip to content

Instantly share code, notes, and snippets.

@yuhua-chen
Created August 4, 2014 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuhua-chen/55f47ec28484436474b1 to your computer and use it in GitHub Desktop.
Save yuhua-chen/55f47ec28484436474b1 to your computer and use it in GitHub Desktop.
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);
for(i=0;i<mc;i++)
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