[Application startup process-three ways to load controllers-morning content review Objective-C language]

1. Let’s first recall all the content in the morning

notify

1. First, let’s talk about the “application startup process”.

There are three aspects in the application startup process:

1) Introduction to UIApplication object

2) Introduction to AppDelegate object

3) Application startup process

Now I don’t know if you have any impressions of the startup process of this application?

2. First, the introduction of this UIApplication object

notify

It itself is an object of type UIApplication.

The most important point in this UIApplication is how to obtain this UIApplication object.

Is it sharedApplication?

can be obtained,

Then, you can find the network status indicator and set the numbers on the avatar in its header file.

openURL, learn about it,

Then, application status bar management, this needs to be configured in the info.plist file.

One thing I need to add to everyone is that after iOS 9.0, Apple does not recommend doing this.

It’s enough to understand it, but you can still write it in the same way,

3. Then, it also has an attribute, which is keyWindow

In this case, is it its main window?

Later, we used it many times,

There is also a delegate attribute used to set its proxy object,

What we will explain to you later is the application proxy object.

4. Then, let’s talk about the application startup process first, right?

I will introduce the AppDelegate class in detail later.

notify

During the startup process,

1) First of all, the first step is to find the main function in the main.m file?

This main function does several things,

- The first one, it creates an autorelease pool

@autoreleasepool

- Second, in this automatic release pool, a method is called, the UIApplicationMain function.

However, although that method has a return value, which is of type int, it will not return.

Right, never return,

This will keep your program and never exit.

What is this effect called? Is it "running loop"? This is a noun.

Let me draw it again, "running loop", you can understand it as a circle,

notify

What does "circle" mean? It means that it keeps moving and keeps running. Our application keeps running.

At this time, if you don’t do anything, it may be in this state.

Guess you like

Origin blog.csdn.net/madoca/article/details/134531156