导入

#import <objc/runtime.h>

 

unsigned int count;
Method *methods = class_copyMethodList([UIAlertAction class], &count);
for (int i = 0; i < count; i++) {
Method method = methods[i];
SEL selector = method_getName(method);
NSString *name = NSStringFromSelector(selector);
NSLog(@"method_getName:%@",name);
}

    unsigned int numIvars;

    Ivar *vars = class_copyIvarList([UIAlertAction class], &numIvars);

    NSString *key=nil;

    for(int i = 0; i < numIvars; i++) {

        

        Ivar thisIvar = vars[i];

        key = [NSString stringWithUTF8String:ivar_getName(thisIvar)];

        NSLog(@"variable_name :%@", key);

    }

    free(vars);

 

相关文章:

  • 2021-12-19
  • 2021-11-01
  • 2021-12-30
  • 2022-02-08
  • 2022-02-08
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
相关资源
相似解决方案