我正在尝试检索当前用户的当前地理点,但是当我调用 geoPointForCurrentLocationInBackground:
时没有任何反应。我无法从 block 中记录 NSLog
,但是另一个 NSLog
出现在控制台中。
- (IBAction)whereCurrentUser:(id)sender {
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
if (geoPoint) {
NSLog(@"GEOPOINT %@", geoPoint);
}
else
{
NSLog(@"ERROR");
}
}];
NSLog(@"BUTTON TAPPED");
}
我还需要实现其他东西吗?文档非常清楚,因此我无法弄清楚可能是什么问题。
最佳答案
Parse.com PFGeoPoint.geoPointForCurrentLocationInBackground not doing anything 上发布了一个解决方案.基本上将 Parse 更新到最新版本并将 NSLocationWhenInUseUsageDescription 键添加到您的 Info.plist,这是在 iOS 8 中所做的更改,无论何时您想要在您的应用程序中使用用户位置都需要。
关于ios - 无法使用 geoPointForCurrentLocationInBackground 检索地理点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27649234/