如何在iPhone中通过查询解析相似计数值
我正在使用 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";
},
我想对我的查询进行排序,就像最喜欢的帖子将位于顶部一样。 我将如何修改我的查询以在顶部显示最喜欢的内容。
提前致谢
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;
}
);
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已将响应格式指定为 JSON 。这就是您收到 JSON 格式的响应的原因。
请参阅下面的博客文章来解析您的回复。
教程:iPhone 上的 JSON Over HTTP
iPhone JSON Flickr 教程 – 第 1 部分
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