Always go for it when you use it, or write it down.
Call conditions for life cycle events in Appdelegate in iOS:
[CPP]View Plaincopy
- When an application is about to go into an inactive state, during which time the application does not accept messages or events, such as incoming calls
- -(void) applicationwillresignactive: (uiapplication *) Application
- {
- NSLog (@"application is going to be inactive, coming into the background");
- }
- The application is running in the background
- -(void) Applicationdidenterbackground: (uiapplication *) Application
- {
- NSLog (@"If the application supports background running, the application is already running in the background");
- }
- The application is about to enter the active state execution
- -(void) Applicationwillenterforeground: (uiapplication *) Application
- {
- NSLog (@"application will enter the active state, will enter the foreground running");
- }
- The application has entered the active state
- -(void) applicationdidbecomeactive: (uiapplication *) Application
- {
- NSLog (@"application has entered the foreground, is active");
- }
- Applications are going to exit, usually used to save the bookshelf to drink some pre-launch cleanup work,
- -(void) Applicationwillterminate: (uiapplication *) Application
- {
- NSLog (@"application will exit, usually used to save the bookshelf to drink some pre-launch cleanup work");
- }
- When the device allocates too much memory to the application, the operating system terminates the application and executes the method before terminating.
- Memory cleanup can usually be done here to prevent the program from being terminated
- -(void) applicationdidreceivememorywarning: (uiapplication *) Application
- {
- NSLog (@"system memory is low, need to clean up");
- }
- Executes when the system time has changed
- -(void) Applicationsignificanttimechange: (uiapplication *) Application
- {
- NSLog (@"execute when system time changes");
- }
- Executes when the program is loaded
- -(void) applicationdidfinishlaunching: (uiapplication *) Application
- {
- NSLog (@"execute when program is loaded");
- }
An event-triggered call in the iOS Appdelegate method