navigationController pop的几种方法

一,popViewControllerAnimated

[self.navigationController popViewControllerAnimated:YES];

 

二,popToRootViewControllerAnimated

[self.navigationController popToRootViewControllerAnimated:YES];

三,popToViewController

[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:2] 
      animated:YES];



//假如你要跳转到DeskViewController
for (UIViewController *temp in self.navigationController.viewControllers) {            
            if ([temp isKindOfClass:[DeskViewController class]]) {
                [self.navigationController popToViewController:temp animated:YES];
            }
        }

 

 

 

posted @ 2015-04-10 18:13  shidaying  阅读(342)  评论(0编辑  收藏  举报