自定义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);
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转字典
- Android 基础总结:(九)Content Provider用法和理解
- Mybatis 系列(2)——SSM(spring mvc+spring+Mybatis)框架整合
- 【转载】mysql存储过程详解
- 天赋是牛人的基因?
- Ajax基本原理
- 在android上实现IOC
- K-means clustering is not a free lunch
- 人脸位置识别
- 2066 三角恋
- 初识ASP.NET MVC
- Dijkstra最短路径算法
- 10+31=100小组项目第三周总结报告
- Android Studio常用快捷键
- 查找和删除倒数第n个节点的问题
- 数据库练习
- 第13周项目2 (1)
- asp.net的验证控件
- Android 基础总结:(八)BroadcastReceiver详解(下)
- Mysql命令