Object-C 获取对象的属性和值

@autoreleasepool {
        
        TestObj *obj = [[TestObj alloc]init];
        obj.age = @"22";
        obj.name = @"lisi";
        obj.gender = @"male";
        
        unsigned int count;
        objc_property_t *properties = class_copyPropertyList([obj class], &count);
        for(int i=0;i%@",key,value);
        }
    }

你可能感兴趣的:(Objective-C基础,Object-C,获取对象的属性和值)