gpt4 book ai didi

ios - 快速解析地理点未获取当前位置

转载 作者:搜寻专家 更新时间:2023-10-31 19:40:02 26 4
gpt4 key购买 nike

当我向后端发送内容时,尝试使用解析 PFGeoPoint.geoPointForCurrentLocationInBackground 获取当前位置。代码看起来像

NSLog("Before block")
PFGeoPoint.geoPointForCurrentLocationInBackground {
(geoPoint: PFGeoPoint!, error: NSError!) -> Void in
NSLog("inside block")
if !error {
// do something with the new geoPoint
}
}

而且我从来没有在控制台上得到我的内部 block 。我安装了 Core Locations Framework,它允许我做类似的事情

let point = PFGeoPoint(latitude:40.0, longitude:-30.0)

如果有帮助,我在执行上述调用时不会被要求提供用户位置。

最佳答案

 NSLocationWhenInUseUsageDescription

NSLocationAlwaysUsageDescription

将这些键放入 info.plist

关于ios - 快速解析地理点未获取当前位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25173329/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com