rickytan / RTRootNavigationController

Implicitly make every view controller has its own navigation bar
MIT License
2.15k stars 379 forks source link

更新库后,导致popToViewController:animated:有问题 #117

Closed ZYongjie closed 7 years ago

ZYongjie commented 7 years ago

采用https://github.com/rickytan/RTRootNavigationController/blob/master/Example/RTRootNavigationController/RTAppDelegate.m#L25-L29 隐藏tabBar,然后在某个一级tab的aVC -> bVC,并将aVC作为属性传递给bVC,则[bVC popToViewController:aVC animated:YES]失效. 见附近demo RTTest.zip

rickytan commented 7 years ago

你这个层级是不对的。

RootNavigationController
`- TabBarController
|    `- ViewController
`- TestViewController

发现了吗?你的 TestViewController 指向的 ViewController 不是跟它一级的,而是 TabBar 的子级。换句话说, ViewController 根本不在 Navigation 的栈中

解决方法:

  1. 直接 popToRoot
  2. 传 TabBar 传 Test