How to insert UINavigationController
inside UITabBarController
.
Currently I have main UITabBarController
with declatarion inside application delegate like this (so tab is main)
self.window.rootViewController = self.tabBarController;
And inside one of tabs I want to insert UINavigationController
, and can't get it.
The code is contructed like this:
MainWindow.xib
withUITabBarController
object with tab typed asUINavigationController
(point toNavigationHistory.xib
) - screenshot: invalid linkNavigationHistory.xib
contains onlyUINavigationController
where view point to History.xibHistory.xib
have onlyUITableView
element - screenshot: invalid link
And now UIViewController
doesn't display my View1 view, and I have no clue why it may be. Maybe you have any clue? or point me to the place where such configuration is done.
Add your controller object to UINavigationController, and add that navigationcontroller object to UITabBarController
UINavigationController is a subclass of UIViewController, a UITabBarController expects an array of UIViewControllers (and therefore UINavigationController ); this tells me me that I can give a UITabBarController an array of UINavigationControllers (or sublasses thereof) giving the desired interaction.
Ref : https://developer.apple.com/library/ios/documentation/UIKit/Reference/UINavigationController_Class/
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UITabBarController_Class/
}
I'll answer myself. It's good explained at https://developer.apple.com/library/ios/#documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/CombiningViewControllers.html
Write a code in appdelegate.m file.....