[英]Close the application when it goes to the background
When the application is sent to the background, i need the application to shutdown completely. 当应用程序发送到后台时,我需要应用程序完全关闭。 Presently, when my app goes to the background, and when i call it back it shows the view i was working before it went to the background.
目前,当我的应用程序进入后台时,当我回拨它时,它会显示我在前往后台之前工作的视图。
I am doing this to release memory. 我这样做是为了释放记忆。
How can i do this programatically ? 我怎么能以编程方式执行此操作?
Add a key UIApplicationExitsOnSuspend
to YES on info.plist 在info.plist上将关键字
UIApplicationExitsOnSuspend
添加到YES
More info here 更多信息在这里
https://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html https://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html
转到您的配置(例如plist文件)并添加以下标记: UIApplicationExitsOnSuspend
并将其设置为true
Do not prevent your app from multitasking just because you have memory issues. 不要因为您遇到内存问题而阻止您的应用程序进行多任务处理。 What you should do is optimize your code and correct these issues.
您应该做的是优化代码并纠正这些问题。
Look at this guide and the methods that it mentions, they will allow you to know if your application is going to the background for example so that you can release some memory. 查看本指南及其提及的方法,它们将允许您知道您的应用程序是否以后台为例,以便您可以释放一些内存。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.