Skip to content

Instantly share code, notes, and snippets.

@holysin
Created January 18, 2014 07:14
Show Gist options
  • Save holysin/8487315 to your computer and use it in GitHub Desktop.
Save holysin/8487315 to your computer and use it in GitHub Desktop.
Print NSObject selectors
void PrintObjectMethods() {
unsigned int count = 0;
Method *methods = class_copyMethodList([NSObject class], &count);
for (unsigned int i = 0; i < count; ++i) {
SEL sel = method_getName(methods[i]);
const char *name = sel_getName(sel);
printf(“%s\n”, name);
}
free(methods);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment