UINavigationController navigation controller and ledcontroller

Source: Internet
Author: User

UINavigationController navigation controller and ledcontroller

The navigation controller of UINavigationController is an important element for jump between multiple interfaces. It can be understood that it stores multiple viewcontrollers. Its storage structure is stack, and the stack features advanced back-to-end, when adding a View Controller, pay special attention to it.

UINavigationController has several common methods:

1: [UINavigationController initWithRootViewController: viewController] indicates which view controller is set as the Root View Controller of the navigation controller, that is, the interface that is first seen during running.

2: [UINavigationController pushViewController: viewController animated: BOOL] refers to sending the View Controller to the stack and redirecting to the next View Controller, that is, the next interface.

3: [UINavigationController popViewControlleranimated: BOOL] refers to the attempt to remove the Controller at the top of the stack, that is, return to the previous interface.

4: [UINavigationController popToRootViewControlleranimated: BOOL] refers to directly returning to the Root View Controller, that is, returning the first interface.

5: [UINavigationController popViewController: viewController animated: BOOL] Jump to the corresponding View Controller, that is, the corresponding interface.

UINavigationController has an attribute viewcontrollers, which is an array. All view controllers are contained in it, and the locations of controllers are the same as those of UINavigationController. You can use [array objectAtIdenx: index] to obtain the corresponding View Controller.

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.