gpt4 book ai didi

iOS8.0.2 CLLocationManager 停止工作,kCLAuthorizationStatusNotDetermined

转载 作者:行者123 更新时间:2023-11-29 10:37:29 24 4
gpt4 key购买 nike

我几个月前开始开发应用程序 (ios7),让位置管理器根据需要工作。

现在在 xCode6/iOS8 中它退出了。这是我看到的。

应用程序启动,位置管理器启动,我得到状态“NotDetermined”。卸载应用程序不会强制弹出窗口或类似的内容。我去设置,选择“总是”允许,设置显示“总是”。启动我的应用程序,同样的问题。进入设置 - 山雀再次显示空白。

这是 iOS8 的已知问题吗?我还能尝试什么?

最佳答案

回答我自己的问题。 iOS8 带来了一些变化。现在我们(开发人员)应该征求用户的许可,以防它是“NotDetermined”。requestAlwaysAuthorization此外,需要新的 .plist 条目

When the current authorization status is kCLAuthorizationStatusNotDetermined, this method runs asynchronously and prompts the user to grant permission to the app to use location services. The user prompt contains the text from the NSLocationAlwaysUsageDescription key in your app’s Info.plist file, and the presence of that key is required when calling this method. After the status is determined, the location manager delivers the results to the delegate’s locationManager:didChangeAuthorizationStatus: method.

https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/cl/CLLocationManager

关于iOS8.0.2 CLLocationManager 停止工作,kCLAuthorizationStatusNotDetermined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26185309/

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