把网络请求得到的字符串转成字典
2015-09-18 22:48
465 查看
- (void)changes { //1.把网络请求得到的数据 StringData 转成 NSData型的jsonData NSData *jsonData = [StringData dataUsingEncoding:NSUTF8StringEncoding]; //2.把 jsonData 转成 字典 messageDic NSDictionary *messageDic = [NSJSONSerialization JSONObjectWithData:jsonDataoptions:NSJSONReadingMutableContainerserror:nil]; NSLog(@"%@",messageDic[@"key"]); // 这个 key 是网络请求得到的数据的key,在取数据的过程中,一定要理清思路怎么去取值。特别注意网络请求的数据有些是字典数组相互嵌套的 }
相关文章推荐
- Tcp/ip三次握手,4次分手.
- SqlServer问题:sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机 localhost 的 TCP/IP 连接失败。错误:“Connectio
- 漫步云中网络
- HttpServletResponse输出的中文乱码
- python网络爬虫
- http content-type
- VMware的三种网络连接方式
- http 的get,put,post,delete
- Http的Cache机制
- TCP/IP协议原理与应用笔记05:TCP/IP协议下的网关
- 网络图可视化工具
- 网络配置
- linux下C语言socket网络编程简例
- TCP/IP协议原理与应用笔记04:子网掩码
- 我的WebUtil工具类--获取IP与发送http请求
- 长春网络赛 1108
- 长春网络赛 1102
- 长春网络赛 1101
- Http请求中Content-Type讲解以及在Spring MVC中的应用
- 网络编程