既然 iPhone 4 确实将应用程序带到后台线程,有没有办法退出应用程序,使其不在后台?我们可以在屏幕上有一个退出按钮吗???
最佳答案
来自iOS Application Programming Guide :
If you do not want your application to remain in the background when it is quit, you can explicitly opt out of the background execution model by adding the UIApplicationExitsOnSuspend key to your application’s Info.plist file and setting its value to YES. When an application opts out, it cycles between the not running, inactive, and active states and never enters the background or suspended states. When the user taps the Home button to quit the application, the applicationWillTerminate: method of the application delegate is called and the application has approximately five seconds to clean up and exit before it is terminated and moved back to the not running state.
关于iphone - 退出 iphone 4 中的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3503614/