zoukankan      html  css  js  c++  java
  • JSON解析问题

    版权声明:本文为博主原创文章,未经博主同意不得转载。 https://blog.csdn.net/quanqinayng/article/details/25121955

    这是data.chatFileModelJson = [dic valueForKey:@"Text"];

    {

        Content = "sU5de5U56fdU4e2dU53e5U53f7U4e2dU56fdd";

        FileKey = "";

        Url = "http://m.im2x.com/d";

    }

    想要不转码的string json

     {

                "Content": "下雨了?

    what?",

                "Url": "http://m.im2x.com/d",

                "FileKey": ""

      }



    今天在解析json时遇到了一个问题,用NSStringJSONValue方法来获取转换后的NSDictionaryNSArray)对象时,NSDictionary中的数据会转码,因为数据库中保存这个NSDictionary中的json,在其他地方要对这个NSDictionary中的json进行解析,就会出错。解决方法也非常easy。使用NSDictionaryNSArray)的JSONRepresentation方法来获取JSONNSString字符串就能够了。

  • 相关阅读:
    设计模式-适配器模式
    设计模式-模板方法模式
    设计模式-策略模式
    spring-消息
    spring-集成redis
    spring-mvc高级技术
    spring-AOP
    restful规范
    十一,装饰器详解
    十,函数对象,嵌套,名称空间与作用域,闭包函数
  • 原文地址:https://www.cnblogs.com/mqxnongmin/p/10587268.html
Copyright © 2011-2022 走看看