iOS多次push,返回指定根模块
2017-09-24 本文已影响10人
WuNai
方法一
self.tabBarController.selectedIndex = 2;
[self.navigationController popToRootViewControllerAnimated:YES];
方法二
MyFunTabBarController *myFunVc = [[MyFunTabBarController alloc] init];
[self presentViewController:myFunVc animated:YES completion:nil];
self.view.window.rootViewController = myFunVc;
方法三
AppDelegate *appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
MyFunTabBarController *myFunVc = [[MyFunTabBarController alloc] init];
myFunVc.selectedIndex = 3;
appdelegate.window.rootViewController = myFunVc;