"We all love Paul Hegarty" Stanford IOS8 public class personal note lifecycle life cycle

Source: Internet
Author: User

Life cycle of iOS:


When the app starts running, it goes into the green section, and the app is already running, but the UI isn't showing up on the screen. Your controller is then displayed on the screen and you are in this active state most of the time the program is running.


When the user clicks on another app, the current app is ready to go backstage.


Running in the background is very short, and then your code will stop running, at this time your code has not been killed, in this state can not do anything, in the run to the background when the request a little more time, but if you do not request, you will soon be converted to a state that is not running, this state is called Hang, Your app will leave the blue area at this point. Once the app arrives in a pending state, it can be killed.


Once you've been killed your app is not running, notice that when the app never runs into an inactive state, the system notifies the program's agent, which is the Appdelegate file.


This appdelegate file is a proxy for the UI Application object, and you never inherit it, there are many ways in which you can do some global operations in these proxy methods.

If you have a phone call when you use the app, the app pauses and the status moves from active to inactive.


From active to inactive such as when your app loads successfully, it calls the method above and loads applicationdidbecomeactive (uiapplication) When your app becomes inactive from inactivity. This proxy method and the Pause proxy method above are a pair. You can use uiapplicationdidbecomeactivenotification this station.


The following proxy method is called when you enter the background:


When you go back from the background to the inactive state again


With Appdelegate you can do the following: When your app is killed, the next boot will start from the page that was previously killed.


Consider a music app that continues to play when we lock the screen or switch to another app. You need to register a function that runs in the background, but if you misuse the background mechanism and consume a lot of power, you will still be killed by the system. iOS is definitely multitasking, it has a philosophy that users are currently interacting with the application should occupy most of the resources of the system.

You can use another app in your app to open a URL, or sign up for a push notification:


By the following Setminimubackgroundfetchinterval method to set the system in the background when the wake-up time interval, the default is never, you can set up in the background for a few more time, switch network traffic indicator pinion (the top of the small)



"We all love Paul Hegarty" Stanford IOS8 public class personal note lifecycle 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.