IOS Dev (39) Do you understand UIApplicationDelegate?

Source: Internet
Author: User

IOS Dev (39) Do you understand UIApplicationDelegate?

  •  
  • application:didFinishLaunchingWithOptions:applicationWillResignActive:applicationDidBecomeActive:applicationWillEnterBackground:applicationWillEnterForeground:applicationDidReceiveMemoryWarning:
    Application: didfinishlaunchingwitexceptions

    This is the first protocol method triggered after the UIApplication is instantiated. The main task of this product is to create a UIWindow where the Controller view is displayed.

    ApplicationWillResignActive:

    This Protocol method is triggered when the application changes from Active to Inactive. For example, when a call is made.

    ApplicationDidBecomeActive

    This Protocol method is triggered when the application changes from Inactive to Active.

    ApplicationWillEnterBackground:

    This Protocol method is triggered when the application switches to the background.

    ApplicationWillEnterForeground:

    This Protocol method is triggered when the application switches to the foreground.

    ApplicationDidReceiveMemoryWarning:

    This Protocol is triggered when the device memory is insufficient. Here I have a question: is it triggered when Background is used?

    If the system still does not have enough memory after the application executes this method, the system may kill the application.

    What if I want to actively obtain AppDelegate?
    [[UIApplication sharedApplication] delegate]

    Haha, that's easy.

    Reprinted please indicate the blog from laruence: http://blog.csdn.net/prevention

Related Article

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.