当前位置 博文首页 > xixi:自定义model 转出 字典
一般 都是 字典转出 Model? 但是Model 也能转出 字典
unsigned int count;
objc_property_t *properties = class_copyPropertyList([youModelClass class], &count);
for(int i = 0; i < count; i++)
{
objc_property_t property = properties[i];
NSLog(@"name:%s",property_getName(property));
NSLog(@"attributes:%s",property_getAttributes(property));
NSString *name = [NSString stringWithUTF8String:property_getName(property)];
NSString *attributes = [NSString stringWithUTF8String:property_getAttributes(property)];
}
free(properties);