runtime 获取对象属性字典


#import "NSObject+object_runtime.h"
#import 

@implementation NSObject (object_runtime)

/**
    获取对象的属性和属性值字典
 */
- (NSDictionary*)objectGetPropertyKeysValues
{
    NSMutableDictionary* dic = [NSMutableDictionary dictionary];
    unsigned int count;
    objc_property_t * prop_list = class_copyPropertyList([self class], &count);
    for (int i=0; i

你可能感兴趣的:(ios,runtime)