简体   繁体   English

位置服务设置为“开”时应用程序崩溃

[英]App crashes when location services set to “On”

I have an app that uses the ALAssets framework to access to the users photo library. 我有一个使用ALAssets框架访问用户照片库的应用程序。 I wrote some code that detects whether or not the app has permission to access the photo library, and if it doesn't, I display an alert message which tells the user to turn on location services for the app in settings. 我写了一些代码来检测应用程序是否有权访问照片库,如果没有,我会显示一条警告消息,告诉用户在设置中打开应用程序的位置服务。 Problem is, when I go into settings and turn location services on or off for my app, it crashes the app (it doesn't matter what view controller the app is on, even one where ALAssets isn't loaded,it still crashes). 问题是,当我进入设置并为我的应用程序打开或关闭位置服务时,它会崩溃应用程序(应用程序所在的视图控制器无关紧要,即使没有加载ALAssets,它仍会崩溃) 。

Does anyone know why this is happening, and what I can do to fix this? 有谁知道为什么会这样,我能做些什么来解决这个问题?

UPDATE: here is the crash report, on this line in main: 更新:这是崩溃报告,主要在这一行:

int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");

it says Thread 1: signal SIGKILL. 它说线程1:信号SIGKILL。

Your app is being killed by iOS. 您的应用被iOS杀死了。 This happens always privacy settings are changed that affect your app. 发生这种情况时,隐私设置的更改会影响您的应用。

See: App killed by SIGKILL when changing privacy settings 请参阅: 更改隐私设置时由SIGKILL杀死的应用程序

In addition: requesting access to the Location services, will not grant you access to the photo library! 此外:请求访问位置服务,不会授予您访问照片库的权限! That one is a separate privacy setting. 那是一个单独的隐私设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM