views:

123

answers:

1

I want to have a TabBar controller inside a navigation controller. So that when an item is selected on the first Navigation Controller it pushes the TabBar into view. Inside this tabbar on the first tab is another navigation controller.

However I only want one navigation bar.

I've come up with 2 ways but not sure which way is better (Ie more acceptable etc)?

1) The first navigation controller isn't actually a navigation controller but to the user it looks like one. So when a cell is selected on it's table view the first navC's view is removed from the superview and the TabBarC's view is added, animation would have to be done manually.

2)The first NavC is actually a NavC and when an item is selected and the TabBar is pushed on to the screen the first NavC's navigationbar is hidden so that the first tab's navigationBar is the only nav bar on screen.

+1  A: 

I don't think this is a good idea. The Framework doesn't support having a tab bar controller as the root view controller in a navigation controller. (Too many 'controllers' in that sentence).

From the docs:

initWithRootViewController:

Initializes and returns a newly created navigation controller.

- (id)initWithRootViewController:(UIViewController *)rootViewController

Parameters

rootViewController

The view controller that resides at the bottom of the navigation stack. This object cannot be an instance of the UITabBarController class.

(italic emphasis mine)

Jasarien
so it would have to be option one, where the tabbarController is not in a navController
Jonathan