The principles of the IOS program life cycle

Source: Internet
Author: User

First, UIApplication life cycle

Each iOS application contains a UIApplication object, and the iOS system monitors the entire application lifecycle through the UIApplication object. Each application specifies a proxy object for the UIApplication object that handles the UIApplication object monitoring lifecycle event.

Two, iOS app has 5 kinds of status

    1. Not Running: The application is not started or the application is running and is stopped by the system halfway.
    2. Inactive: The application is running in the foreground, but does not receive events. (currently or executing other code)
    3. Active: The current application is running in the foreground and receives events.
    4. Background: The application is in the background, and the code is still executing.
    5. Suspended: The application is in the background and stops executing code.

Third, the Agent object Uiapplicationdelegate object: is responsible for processing uiapplication in the life cycle monitoring event.

Four, in the UIApplication proxy object, the life cycle-related functions:

1 // 2- (void) Applicationwillresignactive: (UIApplication *) Application3 4 //5- (void) Applicationdidbecomeactive: (UIApplication *) Application6 7 // 8- (void) Applicationdidenterbackground: (UIApplication *) Application9 Ten //  One- (void) Applicationwillenterforeground: (UIApplication *) Application A  - //  -- (void) Applicationwillterminate: (UIApplication *) Application the  - //  -- (void) Applicationdidreceivememorywarning: (UIApplication *) Application -  + //  -- (void) Applicationdidfinsihlaunching: (UIApplication *) Application +  A //  at-(BOOL) Application: (UIApplication *) application Handleopenurl: (nsurl *) URL

V. uiviewapplication life cycle

The principles of the IOS program life cycle

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.