This simple Objective-C code excerpt prints the methods and arguments of a class instance using the NSLog functionality.
// // List the methods of the class instance "myClass" methods = class_copyMethodList([myClass class], &methodCount); for (int i=0; i<methodCount; i++) { char buffer[256]; SEL name = method_getName(methods[i]); NSLog(@"Method: %@", NSStringFromSelector(name)); char *returnType = method_copyReturnType(methods[i]); NSLog(@"The return type is %s", returnType); // self, _cmd + any others unsigned int numberOfArguments = method_getNumberOfArguments(methods[i]); for(int j=0; j<numberOfArguments; j++) { method_getArgumentType(methods[i], j, buffer, 256); NSLog(@"The type of argument %d is %s", j, buffer); } }







