How to differentiate lock screen and home button (background multitasking) on applicationWillResignActive in the app delegate

牧云@^-^@ 提交于 2019-12-25 07:47:08

问题


I am writing an alarm clock app.

Please correct me if I am wrong:

On both events (lock & home button in iOS 4.x) the applicationWillResignActive: method is called. When locked my app can keep on running (forever if DeepSleepPreventer.h is used) to check if the alarm should go off. When home is pressed it has to stop working at some time (apart from some basic background calculations). So in this case I have to set a local UILocalNotification to trigger the alarm.

So my question: How to differentiate between those two events?

Thank you!


回答1:


Have you tried implementing -applicationDidEnterBackground: in your app delegate?



来源:https://stackoverflow.com/questions/4783152/how-to-differentiate-lock-screen-and-home-button-background-multitasking-on-ap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!