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.