iOS-检测应用程序何时退出 [英] iOS - detect when application exits

查看:275
本文介绍了iOS-检测应用程序何时退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测用户何时退出应用程序? (点击主页按钮) 以及如何检测何时重新启动它? (点击图标)

How can I detect when a user exits the application? (hitting the home button) And how can I detect when the relaunch it? (clicking the icon)

*我不是在说用户通过按住主屏幕按钮然后使图标摆动并从子坞删除应用程序实例来手动退出应用程序.我正在谈论的只是暂时退出应用程序购买,请单击主页"按钮..也许会发送文本或其他内容,然后再返回到应用程序.

*I'm not talking about users manually quitting the app by holding the home button and then making the icons wiggle and deleting the app instance from the sub-dock. i'm talking about just temporarily exiting the app buy clicking the home button.. maybe sending a text or whatnot then coming back to the app.

谢谢!

推荐答案

- (void)applicationDidEnterBackground:(UIApplication *)application

- (void)applicationDidBecomeActive:(UIApplication *)application

在您的AppDelegate.m

In your AppDelegate.m

- (void)applicationWillTerminate:(UIApplication *)application

这篇关于iOS-检测应用程序何时退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆