OBJECT Convert JSON
来源:互联网 发布:绿茶软件下载 编辑:程序博客网 时间:2024/05/10 21:06
//数组转NSData NSData *jsonData = [self toJSONData:self.contactInfosArr]; NSString *insertQuoteStr = [[NSString alloc]initWithData:jsonData encoding:NSUTF8StringEncoding];; WDLog(@"%@",insertQuoteStr);
// 将字典或者数组转化为JSON串- (NSData *)toJSONData:(id)theData{ NSError *error = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:theData options:NSJSONWritingPrettyPrinted error:&error]; if ([jsonData length] > 0 && error == nil){ return jsonData; }else{ WDLog(@"%@",error); return nil; }}
运用runtime API
iOS 将NSArray、NSDictionary转换为JSON格式进行网络传输
http://blog.csdn.net/worldzhy/article/details/49982491
0 0
- OBJECT Convert JSON
- Object convert to Json string
- Convert object to json and json to object in C#
- convert Java object to / from JSON
- Convert Xml to json object in android
- IOS json转对象 /json 转 Object / ios json to Object / ios json convert Object
- IOS json 转 Object / ios json to Object / ios json convert Object
- IOS json 转 Object / ios json to Object / ios json convert Object
- Java JSON - Convert Java Object To / From JSON (Jackson)
- How to convert Java object to / from JSON (Gson)
- How to convert Java object to / from JSON (Gson)
- Json convert to object with gjson.(Json 转换为类对象)
- how to convert a object to json file immediately during debug?
- json convert to string
- json datatime convert
- Convert string to object (c#)
- javaBean Convert to Json Str
- Convert JSON string 转 Map
- 1115. Counting Nodes in a BST (30)
- HDU 1068 Girls and Boys
- [POJ1035]-Spell checker
- C#入门5.2——分支语句之switch语句
- Logistic Regression(基本原理分析+python代码实现)
- OBJECT Convert JSON
- Cannot call this method while RecyclerView is computing a layout or scrolling
- 面向对象三个基本特征
- 搭建redis-sentinel(哨兵机制)集群
- JavaScript 知识点回顾
- 对象与引用
- Akka学习笔记(一):创建Hello World工程
- 工作日志--openSNS二次开发--微店模块部分bug修复,部分功能优化及营业总额功能增加
- ios异常机制