1.跳转到tabbarController(第几个底导)
// [self.navigationController popToRootViewControllerAnimated:YES];
// JLRootTabBarController *rootController=(JLRootTabBarController *)[DHSlideMenuController sharedInstance].mainViewController;
// rootController.selectedIndex = 2;//这是我项目中的
UITabBarController * tab = [[UITabBarController alloc]init];//这是你的主TabBarController
tab.selectedIndex = 2;
2.跳转到普通的ViewController
HeHomeViewController *homeVC = [[HeHomeViewController alloc] init];
UIViewController *target = nil;
for (UIViewController * controller in self.navigationController.viewControllers) {
if ([controller isKindOfClass:[homeVC class]]) { //这里判断是否为你想要跳转的页面
target = controller;
}
}
if (target) {
[self.navigationController popToViewController:target animated:YES];
}