2
我的應用程序需要找到用戶的當前位置,我已經完成了。然後它需要找到當前用戶位置附近的其他用戶。我爲此使用了Parse。到目前爲止,這是我必須得到用戶的當前位置,它的工作至今。我不明白如何找到當前用戶位置附近的其他用戶。有人可以幫我嗎?我真的很感激它。如何使用Parse查找當前用戶位置附近的用戶?
if ([PFUser currentUser] && [PFFacebookUtils isLinkedWithUser:[PFUser currentUser]]) {
[self updateUserInformation];
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
if (!error) {
NSLog(@"User is currently at %f, %f", geoPoint.latitude, geoPoint.longitude);
[[PFUser currentUser] setObject:geoPoint forKey:@"currentLocation"];
[[PFUser currentUser] saveInBackground];
} else {
NSLog(@"%@", error);
return;
}
}];