- (void)dampClass:(Class)c
{
NSString *clasName = NSStringFromClass(c);
NSLog(@"%@", clasName);
NSLog(@"method");
{
unsigned int count = 0;
Method *methodList = class_copyMethodList(c, &count);
NSMutableString *m = [NSMutableString string];
for (int i = 0; i < count; i++) {
Method method = methodList[i];
NSString *d = [NSString stringWithFormat:@"%s, %s \n", sel_getName(method_getName(method)), method_getTypeEncoding(method)];
[m appendString:d];
}
NSLog(@"%@", m);
free(methodList);
}
NSLog(@"vars");
{
unsigned count;
Ivar *ivars = class_copyIvarList(c, &count);
NSMutableString *m = [NSMutableString string];
for(int i = 0 ; i < count ; ++i) {
Ivar ivar = ivars[i];
NSString *d = [NSString stringWithFormat:@"%s, %s \n", ivar_getName(ivar), ivar_getTypeEncoding(ivar)];
[m appendString:d];
}
NSLog(@"%@", m);
free(ivars);
}
}
NSLog(@"%@", m);