我正在尝试检索当前用户的当前地址,但是当我调用geoPointForCurrentLocationInBackground:
时没有任何反应。我无法从块中记录NSLog
,但是另一个NSLog
出现在控制台中。
- (IBAction)whereCurrentUser:(id)sender {
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
if (geoPoint) {
NSLog(@"GEOPOINT %@", geoPoint);
}
else
{
NSLog(@"ERROR");
}
}];
NSLog(@"BUTTON TAPPED");
}
我需要实施别的吗?文档非常清楚,因此我无法弄清楚可能是什么问题。
答案 0 :(得分:2)
在Parse.com PFGeoPoint.geoPointForCurrentLocationInBackground not doing anything上发布了一个解决方案。基本上将Parse更新到最新版本并将NSLocationWhenInUseUsageDescription键添加到Info.plist,这是在iOS 8中进行的更改,只要您想在应用程序中使用用户位置,就需要这样做。