次の状況のロジックを理解するのに苦労しています。
parse を使用して、モバイル アプリ用のフレンド システムを構築しました。簡単に言えば、ユーザーが何かを「フォロー」すると、関係が成立します。その関係には、個々のユーザーがフォローしているすべての人が含まれます。
User
Relationship - Friends (contains all of the users that that overall user has followed)
個々のユーザーが誰をフォローしているかを簡単に問い合わせることができます。
PFQuery *query = [PFUser query];
[query whereKey:@"username" equalTo:@"asg"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
for (PFObject *object in objects) {
PFRelation *friendsRelation = [object objectForKey:@"Friends"];
PFQuery *query = [friendsRelation query];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
NSLog(@"%@", objects);
} else {
}
}];
}
}];
ただし、特定のユーザーをフォローしているユーザーを照会するにはどうすればよいでしょうか? だから、ユーザーのフォロワー。