获取某个类属性(私有和公有)

unsigned int count = 0;
    Ivar *ivars = class_copyIvarList([UIBarButtonItem class], &count);
    
    for (NSInteger i = 0; i < count; i ++) {
        
        NSLog(@"%s",ivar_getName(ivars[i]));
    }

你可能感兴趣的:(获取某个类属性(私有和公有))