An event-triggered call in the iOS Appdelegate method

Source: Internet
Author: User

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
  1. 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
  2. -(void) applicationwillresignactive: (uiapplication *) Application
  3. {
  4. NSLog (@"application is going to be inactive, coming into the background");
  5. }
  6. The application is running in the background
  7. -(void) Applicationdidenterbackground: (uiapplication *) Application
  8. {
  9. NSLog (@"If the application supports background running, the application is already running in the background");
  10. }
  11. The application is about to enter the active state execution
  12. -(void) Applicationwillenterforeground: (uiapplication *) Application
  13. {
  14. NSLog (@"application will enter the active state, will enter the foreground running");
  15. }
  16. The application has entered the active state
  17. -(void) applicationdidbecomeactive: (uiapplication *) Application
  18. {
  19. NSLog (@"application has entered the foreground, is active");
  20. }
  21. Applications are going to exit, usually used to save the bookshelf to drink some pre-launch cleanup work,
  22. -(void) Applicationwillterminate: (uiapplication *) Application
  23. {
  24. NSLog (@"application will exit, usually used to save the bookshelf to drink some pre-launch cleanup work");
  25. }
  26. When the device allocates too much memory to the application, the operating system terminates the application and executes the method before terminating.
  27. Memory cleanup can usually be done here to prevent the program from being terminated
  28. -(void) applicationdidreceivememorywarning: (uiapplication *) Application
  29. {
  30. NSLog (@"system memory is low, need to clean up");
  31. }
  32. Executes when the system time has changed
  33. -(void) Applicationsignificanttimechange: (uiapplication *) Application
  34. {
  35. NSLog (@"execute when system time changes");
  36. }
  37. Executes when the program is loaded
  38. -(void) applicationdidfinishlaunching: (uiapplication *) Application
  39. {
  40. NSLog (@"execute when program is loaded");
  41. }

An event-triggered call in the iOS Appdelegate method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.