xcode 应用程序不在后台模式下运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9677403/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:37:25  来源:igfitidea点击:

Application does not run in background mode

iphoneiosxcodeinfo.plist

提问by Apps 4 U

I have set "Application does not run in background mode" property key to YES and when I hit the home button it only puts the application into background mode when I click home button twice the app is still running in background and when I relaunch the app the application will enter foreground method is called . I have a setting bundle that creates tabs for UITabBarcontroller and I want the app to quit as it need to run the setup method to work out which tabs to show . I tried to use application will enter foreground to remove view controllers from the tabbar controller by reading the settings bundle and it works but the application will enter foreground method is no good as I can not re-add the view controllers I removed if the settings are changed back again so my only option is to quit the app and the application did launch with options method alloc and init all view controller b reading the setting bundle first . Is there any other way to quit the app

我已将“应用程序不在后台模式下运行”属性键设置为“是”,当我点击主页按钮时,它只会将应用程序置于后台模式,当我单击主页按钮两次时,应用程序仍在后台运行,当我重新启动应用程序时应用程序将进入前台方法被调用。我有一个设置包,可以为 UITabBarcontroller 创建选项卡,我希望应用程序退出,因为它需要运行设置方法来确定要显示的选项卡。我尝试使用 application will enter foreground 通过读取设置包从 tabbar 控制器中删除视图控制器,它可以工作,但应用程序将进入前台方法不好,因为如果设置是,我无法重新添加我删除的视图控制器再次改回来,所以我唯一的选择是退出应用程序,应用程序确实使用选项方法 alloc 启动并初始化所有视图控制器 b 首先读取设置包。有没有其他方法可以退出应用程序

回答by

  1. The fact that your app's icon is listed once you double press the Home button is not indicative that it is running. At best, it indicates which apps the user used last.

  2. "Running in the background"and "loaded into memory, ready to resume"are not the same thing. It's a bit similar to how you can shutdown a computer (it's not processing anything), and if put a computer to 'sleep', it's still not processing… but the state of the computer is kept.

  1. 双击主页按钮后会列出您的应用程序图标这一事实并不表示它正在运行。充其量,它表明用户最后使用了哪些应用程序。

  2. “在后台运行”“加载到内存中,准备恢复”不是一回事。这有点类似于您如何关闭计算机(它不处理任何事情),如果将计算机置于“睡眠”状态,它仍然不处理……但计算机的状态会保留。

I would invite you to read the suspendedand backgroundstates : App States and Multitasking.

我会邀请您阅读暂停后台状态:应用程序状态和多任务处理