所有的属性应该也是类似的
NSArray* MethodsOfClass(Class cls){
NSMutableArray *methodObjs = @[].mutableCopy;
unsigned int methodCount = 0;
Method *methods = class_copyMethodList(cls, &methodCount);
if (methods) {
for (unsigned int i =0; i <methodCount; i++) {
SEL sel = method_getName(methods[i]);
const char *name = sel_getName(sel);
NSString *nameString ;
if (name) {
nameString = [NSString stringWithUTF8String:name];
}
YDClass *class = [YDClass new];
class.name = nameString;
class.sel = sel;
[methodObjs addObject:class];
}
}
return methodObjs;
}