【问题标题】:How to parsing this JSON如何解析这个 JSON
【发布时间】:2015-07-24 07:40:24
【问题描述】:

我有这个对象的字典:我这样的 NSLog:

NSLog(@"Result : %@",dictResponse);

我会问如何在 NSMutableArray 中解析/存储所有这些数据

Result : (
        {
        IsLoggedIn = 1;
        LoginError = None;
    },
        (
                {
            "delete_Id" = 1;
            "Id_book" = 118;
            "is_read" = 0;
            name = "xxxxxxx";
            "picture" = "http://www.xxxxxx.com/Images/Img_00001181_small.gif";
            "Text_Author" = "Jostein";
        },
                {
            "delete_Id" = 48;
            "Id_book" = 111;
            "Je_read" = 1;
            name = "xxxxx";
            "picture" = "http://www.xxxxxx.com/Images/Img_00001111_small.gif";
            "Text_Author" = "Suzana";
        }
    )
)

如果我是 NSLog:

NSLog(@"%@",[dictResponse valueForKey:@"Id_book"]);

我明白了:

(
    "<null>",
        (
        118,
        111
    )
)

【问题讨论】:

  • 你已经解析了json,你的问题应该是我猜,如何使用..你能放一些你的解析代码吗?

标签: ios objective-c json parsing


【解决方案1】:

试试

你的objectAtindex : 0

<null>

你的objectAtindex : 1

NSLog(@"%@",[[dictResponse valueForKey:@"Id_book"]objectAtIndex:1]);

【讨论】:

  • 其实我们不知道你是如何对JSON进行消毒的,这里我提交我的答案是随机的,但是错了你能提交你的代码吗容易优化答案
猜你喜欢
  • 2011-10-04
  • 2016-12-06
  • 2020-08-11
  • 1970-01-01
  • 2016-08-20
  • 2023-03-12
  • 1970-01-01
相关资源
最近更新 更多