您的位置:首页 > 其它

自定义model 转出 字典

2016-05-29 21:59 381 查看
一般 都是 字典转出 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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  model转字典