0
我正在使用iOS。我應該在whereKey上添加什麼:@「objectId」?
如果我插入@ 「OBJECTID」 在whereKey:@ 「」。我得到一個錯誤:壞特殊鍵:objectId。
這是我的代碼:
PFQuery *findFriends = [PFUser query];
[findFriends whereKey:@"objectId" equalTo:friendsID];
[findFriends selectKeys:@[@"firstname",@"lastname"]];
[findFriends findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
NSLog(@"%@", objects);
}
}];
friendsID是從用戶當前用戶是繼OBJECTID一個NSString。
謝謝!
我比較過objectId的這種方式,是你的'friendsID'變量絕對是一個objectId字符串嗎?你可以在查詢之前說明你是如何簽署它或NSLog(@「%@」,friendsID)並告訴我值的。 – Logan
@Logan是的,friendsID是一個objectId。值:qvcFLA9vHs –
@Logan的NSString * friendsID = [[朋友objectAtIndex:0] objectForKey:@ 「TOUSER」]; –