【发布时间】:2014-04-15 20:12:03
【问题描述】:
我的应用需要找到用户的当前位置,我已经做到了。然后它需要找到当前用户位置附近的其他用户。我为此使用 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;
}
}];
【问题讨论】:
标签: ios objective-c geolocation parse-platform geocode