Questions about the Uinavigationcontroller jump

Source: Internet
Author: User

When you use Uinavigationcontroller for app navigation, you typically use push && pop for view switching:

When a button is clicked into a new view, Pushviewcontroller is generally used, and only Uinavigationcontroller and its subclasses have the method.

When returning a view, there are generally 3 methods (which may return a multilayer view):

1.popViewController, return to the previous Layer view controller.

2.popToRootViewController, returns the root view controller.

3.popToViewController, jump to this view controller in the middle of an interface, in this way, you need to know which interface to jump to, to get the interface to jump to have a lot of ways, You can traverse the viewcontrollers array of Uinavigationcontroller and use the Iskindofclass method to get a controller object and then jump.

Of course, you can also return a view controller that specifies several layers relative to the current view controller, with the following code:

... Nsinteger index = [self.navigationController.viewControllers indexofobject:self]; [Self.navigationcontroller poptoviewcontroller:[self.navigationcontroller.viewcontrollers objectAtIndex:index-3] Animated:no];..


Questions about the Uinavigationcontroller jump

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.