如何在iphone中通过查询解析计数值

时间:2011-06-24 10:36:35

标签: objective-c facebook-fql

我正在使用FQL。这是我的代码,它是来自流表的消息。

 NSString *fql = [NSString stringWithFormat:@"SELECT actor_id, message,likes FROM stream WHERE source_id = %lld  ORDER BY likes limit 50",_session.uid]

我得到的结果如下。

{
    "actor_id" = 100002464401210;
    likes =         {
        "can_like" = 1;
        count = 2;
        friends =  (
            {
                uid = 10000215363608;
            }
        );
        href = "http://www.facebook.com/browse/?type=likes&id=106536123438461";
        sample =             (
        );
        "user_likes" = 1;
    };
    message = "hello wall testing..";
},
    {
    "actor_id" = 10000223601210;
    likes =         {
        "can_like" = 1;
        count = 0;
        friends =             (
        );
        href = "http://www.facebook.com/browse/?type=likes&id=108123469280566";
        sample =             (
        );
        "user_likes" = 0;
    };
    message = "New integration";
},

我想对我的查询进行排序,就像最喜欢的帖子一样。 如何修改我的查询以显示最喜欢的内容。

提前致谢

1 个答案:

答案 0 :(得分:0)

您已将响应格式指定为JSON。这就是您获得JSON格式响应的原因。

请参阅以下博客文章来解析您的回复。

Tutorial: JSON Over HTTP On The iPhone

iPhone JSON Flickr Tutorial – Part 1