Skip to content

Instantly share code, notes, and snippets.

@xslim
Created February 9, 2012 10:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xslim/1779062 to your computer and use it in GitHub Desktop.
Save xslim/1779062 to your computer and use it in GitHub Desktop.
Print all methods from class
#include <objc/runtime.h>
#include <objc/message.h>
+ (void)printClassMethods:(Class)class {
NSLog(@"Methods in %@", NSStringFromClass(class));
unsigned int out_count = 0;
Method *class_methods = class_copyMethodList(class, &out_count);
for (int i = 0; i < out_count; i++) {
Method m = class_methods[i];
NSLog(@"\t%@", NSStringFromSelector(method_getDescription(m)->name));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment