美文网首页
获取未知类的所有方法

获取未知类的所有方法

作者: Zxinli | 来源:发表于2019-01-10 20:31 被阅读0次
    Class themeClass = NSClassFromString(@"YourClassName");
        unsigned int outCount = 0;
        Method *methodList = class_copyMethodList(themeClass, &outCount);
        for (int i = 0; i < outCount; i++) {
            Method method = methodList[i];
            const char *name = sel_getName(method_getName(method));
            NSLog(@"method: %s", name);
        }
    
        id manager = [[themeClass alloc] init];
        //po [manager _methodDescription]
    
        NSObject *theme = [pkClass performSelector:@selector(sharedThemeManager)];
        if (theme) {
            NSLog(@"available");
        }
    

    相关文章

      网友评论

          本文标题:获取未知类的所有方法

          本文链接:https://www.haomeiwen.com/subject/iyrzrqtx.html