哪个事件当我关闭应用程序在iOS? [英] Which Event When i close app in iOS?
问题描述
我需要在iOS中关闭我的应用程序时执行事件,如下图所示。
当我用减号按钮关闭应用程序时,我想要捕获该事件。
我需要做哪个事件?
即将终止。
- (void)applicationWillTerminate:(UIApplication *)app
{
}
如果您使用iOS 4或更高版本并支持多任务, applicationWillTerminate $
要接收终止事件,您需要添加 UIApplicationExitsOnSuspend
键 info.plist
检查此 文章 。 >
I need to implement event when i close my app in iOS like following pic.
I want to catch that event when i close app with that minus button.
Which event i need to do?
This delegete will be called when your application is going to terminate.
- (void)applicationWillTerminate:(UIApplication *)app
{
}
If you are using iOS 4 or greater and with multi-tasking support, applicationWillTerminate
will not be called.
For receiving the terminate event you need to add UIApplicationExitsOnSuspend
key on your info.plist
Check this article for a good understanding about application events.
这篇关于哪个事件当我关闭应用程序在iOS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!