无法使用geoPointForCurrentLocationInBackground检索geopoint

时间:2014-12-25 17:09:46

标签: ios objective-c parse-platform

我正在尝试检索当前用户的当前地址,但是当我调用geoPointForCurrentLocationInBackground:时没有任何反应。我无法从块中记录NSLog,但是另一个NSLog出现在控制台中。

- (IBAction)whereCurrentUser:(id)sender {

    [PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *geoPoint, NSError *error) {
        if (geoPoint) {

            NSLog(@"GEOPOINT %@", geoPoint);

        }

        else

        {
              NSLog(@"ERROR");
        }
    }];
    NSLog(@"BUTTON TAPPED");
}

我需要实施别的吗?文档非常清楚,因此我无法弄清楚可能是什么问题。

1 个答案:

答案 0 :(得分:2)

Parse.com PFGeoPoint.geoPointForCurrentLocationInBackground not doing anything上发布了一个解决方案。基本上将Parse更新到最新版本并将NSLocationWhenInUseUsageDescription键添加到Info.plist,这是在iOS 8中进行的更改,只要您想在应用程序中使用用户位置,就需要这样做。