如何在singleview应用程序中将thirdviewcontroller弹出到firstviewcontroller

Par*_*ara 0 uiviewcontroller ios

在我的app我有三个uiviewcontroller:firstviewcontroller,secondviewcontroller和thirdviewcontroller.

我使用navigationcontroller从firstviewcontroller转到secondviewcontroller,然后从secondviewcontroller转到thirdviewcontroller

我想从thirdviewcontroller返回到fristviewcontroller.

Ash*_*osh 8

使用下面的代码:

    [self.navigationController popToRootViewControllerAnimated:YES];
Run Code Online (Sandbox Code Playgroud)

也可以移动到导航层次结构中的任何特定viewController,您可以使用下面的代码:

[self.navigationController popToViewController:<#(UIViewController *)#> animated:<#(BOOL)#>];
Run Code Online (Sandbox Code Playgroud)