Skip to content

Instantly share code, notes, and snippets.

@mkuliszkiewicz
Created November 3, 2016 15:17
Show Gist options
  • Save mkuliszkiewicz/2ecee91654b6dc8a4674924f0c93a7b4 to your computer and use it in GitHub Desktop.
Save mkuliszkiewicz/2ecee91654b6dc8a4674924f0c93a7b4 to your computer and use it in GitHub Desktop.
#import <objc/runtime.h>
void DumpObjcMethods(Class clz) {
unsigned int count = 0;
Method *methods = class_copyMethodList(clz, &count);
printf("Found %d methods on '%s'\n", count, class_getName(clz));
for (unsigned int i = 0; i < count; i++) {
Method method = methods[i];
printf("\t'%s' has method named '%s' of encoding '%s'\n",
class_getName(clz),
sel_getName(method_getName(method)),
method_getTypeEncoding(method));
}
free(methods);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment