Uinavigationcontroller navigation Controller, is an important element of multiple interface jumps, can be understood as it stores multiple viewcontroller, its storage structure is a stack, the characteristics of the stack is advanced, so when adding a view controller, to pay special attention.
There are several common methods of Uinavigationcontroller:
1:[uinavigationcontroller Initwithrootviewcontroller:viewcontroller] refers to which view controller is set as the root view controller of the navigation controller, which is the interface that is first seen by the runtime.
2:[uinavigationcontroller Pushviewcontroller:viewcontroller Animated:bool] means the view controller is fed into the stack and jumps to the next view controller, the next interface.
3:[uinavigationcontroller Popviewcontrolleranimated:bool] refers to the attempt to move the top of the stack out of the controller, that is, return to the previous interface.
4:[uinavigationcontroller Poptorootviewcontrolleranimated:bool] means to return directly to the root view controller, that is, to return to the first interface.
5:[uinavigationcontroller Popviewcontroller:viewcontroller Animated:bool] jumps to the corresponding view controller, which is the corresponding interface.
Uinavigationcontroller has a property, Viewcontrollers, which is an array in which all the view controllers are included, trying to position the controller in the same order as the Uinavigationcontroller. The corresponding view controller can be obtained by [array Objectatidenx:index].
Uinavigationcontroller Navigation Controller