runtime-获取类的所有方法

首先导入头文件#import

#pragma mark - 获取类的所有方法
- (NSArray *)getClassMethods {
    
    NSMutableArray *mutArr = [NSMutableArray array];
    
    unsigned int outCount;
    
    /** 第一个参数:要获取哪个类的方法
     * 第二个参数:获取到该类的方法的数量
     */
    Method *methodList = class_copyMethodList([UIView class], &outCount);
    
    // 遍历所有属性列表
    for (int i = 0; i

你可能感兴趣的:(runtime-获取类的所有方法)