我目前正在尝试使用以下代码获取用户的当前位置:
- (IBAction)askForLocation:(id)sender {
NSLog(@"here");
[PFGeoPoint geoPointForCurrentLocationInBackground:^(PFGeoPoint *point, NSError *err){
NSLog(@"callback");
NSLog(@"point: %@",point);
}];
}
当调用该函数时,它会打印" here",但从不打印"回调"或任何表明存在问题的错误。知道我做错了什么吗?我已正确安装Parse
,因为我可以正确创建新用户。
答案 0 :(得分:2)
您很有可能需要在info.plist中添加以下密钥...
<key>NSLocationWhenInUseUsageDescription</key>
<string>The text you want to appear to the user to access their location.</string>
这与您只是使用CLLocation相同。 NSLocationWhenInUseUsageDescription是iOS 8中的新要求。