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字符串就能够了。

  • 相关阅读:
    [loj3031]聚会
    [loj3146]路灯
    [loj2049]网络
    [luogu7599]雨林跳跃
    [loj3069]整点计数
    [loj3301]魔法商店
    [loj3333]混合物
    [cf1515I]Phoenix and Diamonds
    [cf1515H]Phoenix and Bits
    [atARC116F]Deque Game
  • 原文地址:https://www.cnblogs.com/mqxnongmin/p/10587268.html
Copyright © 2011-2022 走看看