依次关闭一个modalView和一个pushView

时间:2012-05-14 14:53:28

标签: iphone ios dismiss

我怎么能解除tableView4的tableViewController中的tableView4和tableView3?

rootView(tableView1,tabView的一个选项卡,嵌入在navigationController中) - > pushView1(tableView2) - > pushView2(tableView3) - > ModalView1(tableView4,嵌入在navigationController中)

3 个答案:

答案 0 :(得分:1)

在你的模态视图上调用dismissViewControllerAnimated:completion:然后在你想要的视图上调用popViewControllerAnimated :.

答案 1 :(得分:1)

   UINavigationController *myNavController = [myViewController navigationController];
   [myViewController dismissViewControllerAnimated:YES completion:^{
        [myNavController popToViewController:[myNavController.viewControllers objectAtIndex:1] animated:YES];
    }];

答案 2 :(得分:1)

试试这个:

UINavigationController *myNavController = [myViewController navigationController];
[myNavController popToViewController:[myNavController.viewControllers objectAtIndex:1];
[myViewController dismissViewControllerAnimated:YES completion:nil];