[Using navigation controller Objective-C language through storyboard]

1. Let’s take a look at it. Everyone already knows the correct usage of the previous navigation controller.

notify

1. Then, what else is there? Is the jump and return of the navigation controller also clear?

It is also clear why we can return directly.

This navigation controller stack is the core focus of our project.

Everyone can understand, is there any problem? If there is a problem, it is normal, because we have just started to come into contact with this thing, and you are not used to it. Just type two codes and you will find that this is what happened.

2. Then, there is another point. Let me tell you, in the above code, we have the basic use of the navigation controller.

notify

What are they? Is it equivalent to using pure code?

notify

Yes, it is used through pure code.

Create a controller, but when creating this controller, a xib is assigned to it.

Let me emphasize this to everyone again,

Then, the wrong jump method we talked about in the last lesson directly created a new controller, which was not in the navigation controller stack. It jumped directly to the newly created controller, causing the program to crash. This wrong method, I commented it out,

notify

#warning error

notify

Then, for the above correct methods, I will uncomment them,

notify

Taking a controller out of the stack to jump is what we should do.

notify

Then, change the greenVc below to vc.

notify

greenVc, change to vc,

notify

This #waring is wrong. It should be #warning. There is an n missing. Please change it.

notify

Okay, what about these, about our navigation controller, through the use of code,

Is it very simple, jump, return, and then, as well as some of its details, some of the details of the return, do you also know it?

2. Next, let’s see how to use this navigation controller through the storyboard.

1. What about me, then, create a new project,

notify

Create a new Xcode Project,

notify

Click Next, Name, come up with one,

notify

Name: - Use navigation controller through storyboard

notify

Then, I look at the code number and click Next.

notify

It’s time for the 07th code, right?

Return to the previous step, change Name: to 07-use the navigation controller through storyboard

notify

Then, click Create,

notify

2. Okay, use the navigation controller through the storyboard. Have we used other controllers through the storyboard before?

TableViewController, have you used it? Have you used it?

There’s nothing difficult about this, so let’s just get started.

Moreover, I want to tell you that now I want to use the Main.storyboard of the system.

notify

No problem, right?

Once it starts, will it load the Main.storyboard file?

Then I click on the associated class here,

notify

Is the associated ViewController type?

notify

Then I'll delete it,

notify
notify

Then, throw away this controller and use my own navigation controller.

notify

So, select this controller, Delete,

So, it is useless,

notify

Then, delete these two things, ViewController.h and ViewController.m.

notify

Hold down the Shift key and select these two files.

notify

Right click, select Delete, and then, Move to Trash,

notify

We only leave one Main.storyboard,

notify

Okay, then let's start with a navigation controller.

Let me tell you where it is. On our right, the first row, the third one, this controller with the return arrow.

notify

Click on the one with the arrow.

notify

It's the navigation controller,

Hold down the left mouse button and drag it over,

notify

It itself will have a root controller called UITableViewController.

notify

notify

Does this Root View Controller exist?

Let me tell you something, so I deleted it.

notify

Select the UITableViewController on the right and press Delete.

Guess you like

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