ios – Parse geopoint swift没有获得当前位置

ios – Parse geopoint swift没有获得当前位置,第1张

概述尝试使用解析PFGeoPoint.geoPointForCurrentLocationInBackground来获取当我向后端发送内容时的当前位置.代码看起来像 NSLog("Before block") PFGeoPoint.geoPointForCurrentLocationInBackground { (geoPoint: PFGeoPoint!, error: NS 尝试使用解析PFGeoPoint.geoPointForCurrentLocationInBackground来获取当我向后端发送内容时的当前位置.代码看起来像

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

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

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

如果在我上面的呼叫时,我没有被要求提供用户位置.

解决方法
NSLocationWhenInUseUsageDescription

NSLocationAlwaysUsageDescription

将此键放在info.pList中

总结

以上是内存溢出为你收集整理的ios – Parse geopoint swift没有获得当前位置全部内容,希望文章能够帮你解决ios – Parse geopoint swift没有获得当前位置所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1024417.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存