[英]How to get applicationWillTerminate Notification for an iOS App that has Backgrounding Enabled?
所以我知道, applicationWillTerminate:
不会被调用,如果您的应用支持后台执行(除非有一些内存的问题),并applicationDidEnterBackground:
被称为替代。
在appDelegate的applicationDidEnterBackground:
方法内部,它说
// If your application supports background execution,
//this method is called instead of applicationWillTerminate: when the user quits.
但是,当用户实际退出应用程序时,我需要将一些条目保存到字典中。 我不想每次应用程序进入后台时都执行此操作。 即使我的应用程序支持后台,有没有办法获得终止通知?
具体来说,如果该应用被用户强行退出,那么有什么解决方法可以得到此通知?
每次应用进入背景时保存。 操作系统可能会在没有任何进一步警告的情况下杀死您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.