运行时获取属性列表

#import



    unsigned int count;

    objc_property_t *properties = class_copyPropertyList([self class], &count);

    for (int i = 0; i

        objc_property_t property = properties[i];

        

        NSLog(@"name:%s",property_getName(property));

        NSLog(@"attributes:%s",property_getAttributes(property));

    }

    free(properties);


你可能感兴趣的:(笔记)