tabbarcontroller 内嵌导航 控制器,2层push hide tabbar 后 ,第二层直接返回根视图控制器选择tabbarcontroller的其它vc 无法显示 tabbar的 问题解决方案

场景如标题

这样不行:

[self.navigationController popToRootViewControllerAnimated:YES];

MainViewController *mainCtrl = [(AppDelegate *)[UIApplication sharedApplication].delegate mainCtrl];

mainCtrl.selectedIndex = 3;

这样tabbar 怎么都不会出来的。。

 

这样才可以。。可能还是 这个 层次结构 apple 内部的执行 有些问题吧

[self.navigationController popToRootViewControllerAnimated:YES];

 [self performSelector:@selector(test) withObject:nil afterDelay:0];

 

- (void)test

{

    MainViewController *mainCtrl = [(AppDelegate *)[UIApplication sharedApplication].delegate mainCtrl];

    mainCtrl.selectedIndex = 3;

}

原文地址:https://www.cnblogs.com/Keys/p/4588468.html