How to react to applicationWillResignActive from anywhere?

前端 未结 4 839
無奈伤痛
無奈伤痛 2020-12-09 01:31

What\'s the code to subscribe to an event like applicationWillResignActive in any place in your iphone application?

[UPDATE]

Let me rephrase my question. I

4条回答
  •  一整个雨季
    2020-12-09 02:18

    Take a look at the documentation for the method you're talking about:

    applicationWillResignActive:

    Tells the delegate that the application will become inactive. This method is optional.

    - (void)applicationWillResignActive:(UIApplication *)application
    

    [...]

    Discussion

    [...]

    Just before it becomes inactive, the application also posts a UIApplicationWillResignActiveNotification.

提交回复
热议问题