I have a tabbar-based application with following tabs structure:
Tab A - ATabViewController - enclosed by UINavigationController
Tab B - BTabViewController - enclosed by UINavigationController
At some point, clicking on a button in a view, which resides in A navigation stack should pop up some CViewController, which should be pushed in BTabViewController, in such a way, that its back button will show the title of BTabViewController.
My question is
1. how to get the right navigation controller to call the pushViewController:CViewController?
2. The tab B still wasn't tapped at thi开发者_StackOverflow社区s point, so the question is whether I have to load it manually?
It's wired in the MainMenu.xib to load BTabViewController's xib
I tried following:
[[appDelegate tabBarController] setSelectedIndex:BTab_Index];
[[appDelegate tabBarController].selectedViewController pushViewController:CViewController animated:YES]
which indeed showed CViewController, but seems, messed up there something so the Back button showed the title of CViewController and when pressed showed parts of CViewController and BTabViewController mixed in one view...
Thanks
use this,
At button click from Atab Bar view
[[appDelegate tabBarController] setSelectedIndex:1];
(1 for second tab)
and in this view BTabViewController use viewWillAppear method
and push the c view;
then back button show the option for BTabView.
精彩评论