iOS-用Runtime获取对象私有属性

以PHAsset为例子

for (PHAsset *asset inself.assetsFetchResults) {
    unsigned int count;
    // 获取属性列表
    objc_property_t *propertyList = class_copyPropertyList([asset class], &count);
    for (unsigned int i = 0; i%@", [NSString stringWithUTF8String:propertyName]);
    }   
}

你可能感兴趣的:(iOS-用Runtime获取对象私有属性)