我有以下代码,在其中尝试根据用户ID数组检索用户:
NSArray *userIDsWhoLikedPhoto = [self.photo objectForKey:@"usersThatLikedPicture"];
PFQuery *userQuery = [PFUser query];
[userQuery whereKey:@"objectId" containsAllObjectsInArray:userIDsWhoLikedPhoto];
[queryQuery findObjectsInBackground];
但是,我总是收到错误“
Error: $all only works on array fields (Code: 102, Version: 1.2.18)
”。我不太确定自己在做什么错,因为我传入了一个数组作为查询项。谢谢!
最佳答案
想通了:
[userQuery whereKey:@"objectId" containedIn:userIDsWhoLikedPhoto];