我使用Facebook iOS库通过Facebook查询语言访问用户的朋友数据。要按名称搜索特定的朋友,我使用以下NSString:
[NSString stringWithFormat:@"SELECT pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND strpos(lower(name),'%@') >= 0 ORDER BY name", name]
所以查询看起来像这样:
SELECT pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND strpos(lower(name),'firstname lastname') >= 0 ORDER BY name
当朋友在facebook上设置他们的名字给昵称时,我遇到了问题 - 查询没有返回任何结果。例如,如果我查询Benjamin Button,但他已将自己的名字设置在Facebook上给Ben Button,我运气不好。
如何修改此查询以允许这样的昵称?或者至少在名称中间允许某种通配符操作符?
谢谢! 詹姆斯