- first I Install TabBarController directly as a window’s root view controller,and hava a NavigationController in viewControllers.
- when the app run, I push some new viewcontroller onto the navigation stack
- than I tap navigation tabbaritem, the navigationController poptoRootViewController
How can I crash the step 3 event or stop it pop to root?
My solution to stop auto pop to root viewcontroller:
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
UITabBarController *tbc = [[UITabBarController alloc]init];
tbc.viewControllers = [NSArray arrayWithObjects:rvc,nil];
tbc.delegate = self;}
-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
if([tabBarController selectedViewController] == viewController)
return NO;
return YES;}
if you have an anther solution,wellcome write down.