首页 > 代码库 > JSON解析问题
JSON解析问题
这是data.chatFileModelJson = [dic valueForKey:@"Text"];
{
Content = "s\U5de5\U56fd\U4e2d\U53e5\U53f7\U4e2d\U56fdd";
FileKey = "";
Url = "http://m.im2x.com/d";
}
想要不转码的string json:
{
"Content": "下雨了?what?",
"Url": "http://m.im2x.com/d",
"FileKey": ""
}
今天在解析json时遇到了一个问题,用NSString的JSONValue方法来获取转换后的NSDictionary(NSArray)对象时,NSDictionary中的数据会转码,由于数据库中保存这个NSDictionary中的json,在其它地方要对这个NSDictionary中的json进行解析,就会出错,解决方法也很简单,使用NSDictionary(NSArray)的JSONRepresentation方法来获取JSON的NSString字符串就可以了。
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。