简体   繁体   中英

How to call a method upon iPhone app re-opening

I have a method that I want to call not the first time the app launches from being not open at all, but whenever the app opens at all, whenever. So if the app is open, then the user closes it, but it is still running through multitasking, I want to the method to run when they resume the app as well.

applicationWillEnterForeground:

In iOS 4.0 and later, this method is called as part of the transition from the background to the active state. Specifically, it is not called when the application is launched for the first time -- which is what you are looking for.

- (void) applicationWillEnterForeground:(UIApplication *)application {

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM