The home page of sub-VC on tabbarVC jumps to the sub-VC user center, and the jump is successful. But click on the home page, still keep the page state before the jump, how to initialize the home page?

tabbar is the root view

 :targetVC
 :""targetVCMainVC
 :
    //tabbar
    UITabBarController *tabbarVC = (UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController;
    tabbarVC.selectedIndex = 1;

demo

Ios
Mar.02,2021

makes me dizzy. Just say which vc is put in tab, level by level, and then say operation, which step has a problem


[tabCon setSelectedIndex:1];
[self.navigationController popViewControllerAnimated:YES];


[self.navigationController popToRootViewControllerAnimated:YES];
tabbar.selectedIndex = 1;

Menu