Application did enter background function

风格不统一 提交于 2019-12-12 01:34:55

问题


Hey I got a pretty low interval timer in my firstViewController which I would like to terminate when the app enters background, but how am I supposed to access it from my Applications AppDelegate file where the function is located. I know this is extremely dumb question, but I would appreciate help. Thanks!


回答1:


In your firstViewController, you would listen for UIApplicationDidEnterBackgroundNotification.

In the firstViewController init method:

- (void)addObserver:(id)notificationObserver selector:(SEL)notificationSelector name:(NSString *)notificationName object:(id)notificationSender


来源:https://stackoverflow.com/questions/5327278/application-did-enter-background-function

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