【问题标题】:Store the static json string into an string将静态json字符串存入字符串
【发布时间】:2012-07-13 09:11:38
【问题描述】:

我尝试以下面的方式存储 json 字符串

NSString * str =@"{"CategoryID":1,"ItemCount":1,"level":1,"Name":"Boots","Description":"Boots descrition","childs":[{"CategoryID":2,"ItemCount":1,"level":2,"Name":"Cold Water","Description":"Cold Water Description","childs":[]}]}]";

我收到一条错误消息。我知道这是一个非常小的解决方案。 而且我尝试了很多 NSString 方法,但我没有得到解决方案。 我将如何存储这个字符串?

提前谢谢...

【问题讨论】:

  • “我收到一条错误消息”。那是什么?
  • 错误应该是';'在声明的末尾

标签: json nsstring apex-code


【解决方案1】:

我终于找到了我的问题的解决方案

我们需要通过下面的方式传递字符串。

 NSString*str=@{\"CategoryID\":1,\"ItemCount\":1,\"level\":1,\"Name\":\"Boots\",\"Description":\"Boots descrition\",\"childs\"[{\"CategoryID\":2,\"ItemCount\":1,\"level\":2,\"Name\":\"Cold Water\",\"Description\":\"Cold Water Description\",\"childs\":[]}]}];

【讨论】:

    猜你喜欢
    • 2022-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-21
    • 2013-03-18
    相关资源
    最近更新 更多