开发者

How to parse like count value by query in iphone

开发者 https://www.devze.com 2023-03-14 23:07 出处:网络
I am using FQL. And here is my code which is fethcing message from stream table. NSString *fql = [NSString stringWithFormat:@\"SELECT actor_id, message,likes FROM stream WHERE source_id = %lldORDER

I am using FQL. And here is my code which is fethcing message from stream table.

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

And I am getting result like below.

{
    "actor_id" = 100002464401210;
    likes =         {
        "can_like" = 1;
        count = 2;
        friends =  (
            {
                uid = 10000215363608;
         开发者_如何学Python   }
        );
        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";
},

I want to sort my query like most liked post will be on top. How will I modify my query to show most liked on top.

Thanks in advance


You have specified the response format as JSON .That' why you are getting response in JSON format.

See below blog post to parse you response.

Tutorial: JSON Over HTTP On The iPhone

iPhone JSON Flickr Tutorial – Part 1

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号