打印类的方法列表
#pragma mark 打印类的方法列表
- (void)getMethodList:(Class)cls {
unsigned int count;
NSMutableString *string = [NSMutableString string];
Method *methodList = class_copyMethodList(cls, &count);
for (int i = 0; i < count; i++) {
Method method = methodList[i];
SEL sel = method_getName(method);
NSString *methodName = NSStringFromSelector(sel);
[string appendString:methodName];
[string appendString:@" "];
}
free(methodList);
NSLog(@"打印方法列表:%@", string);
}
本文标题:打印类的方法列表
本文链接:https://www.haomeiwen.com/subject/yrmcyltx.html
网友评论