0

似乎在从 Facebook API 调用访问数据时遇到问题。返回的数据按以下顺序排列:

{
comments =     {
    data =         (
                    {
        }
    )
}
}

已经尝试了很长时间,但是在这种情况下我将如何访问数据/评论?我的代码类似于:

NSLog(@"%@",allData);

for (NSDictionary *item in allData) {
    NSDictionary *comments = [item objectForKey:@"comments"];
    //ALSO TRIED
    NSArray *comments = [item objectForKey:@"comments"];
}

以上两种方法似乎都会抛出错误

4

1 回答 1

0

啊,真是个李子!

基本上不需要 for 循环,所以它只是:

[allData objectForKey:@"comments"]

谢谢大家,会留给其他人的:D

于 2012-12-03T09:03:02.000 回答