The methods inside the Appdelegate

Source: Internet
Author: User




Method BriefdidFinishLaunchingWithOptions:(NSDictionary *)launchOptionsCalled only when the app is launched, the following launchoptions contains the parameters to launch the application from the outside, such as receiving a pick-up and clicking on the information contained in the push to open the app.
applicationWillResignActiveApplicationbackgroundBefore calling
applicationDidEnterBackgroundApplicationbackgroundCall
applicationWillEnterForegroundApplicationactiveBefore calling
applicationDidBeconeActiveApplicationactiveCall
applicationWillTerminateApplicationnot runingCalled before (Close)
Several common scenarios:
  1. To launch an app:

    • didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    • applicationDidBeconeActive
  2. Within the app, click Home:

    • applicationWillResignActive
    • applicationDidEnterBackground
  3. The app runs in the background and opens the app again:

    • applicationWillEnterForeground
    • applicationDidBeconeActive
  4. Double-click Home to select the current app:

    • applicationWillResignActive
    • applicationDidBeconeActive
  5. Double-click Home to select another app:

    • applicationWillResignActive
    • applicationDidEnterBackground
  6. Double-click Home to close the app:

    • applicationWillResignActive
    • applicationDidEnterBackground
    • applicationWillTerminate



Appdelegate related states in several methods:1.not Running2.background3.active
the actual application of several states: (see "iOS app status switch off " http://blog.csdn.net/duanyipeng/article/details/7101829)
1.not Running2.background3.active4.inactive5.suspended

The methods inside the Appdelegate

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.