views:

122

answers:

1

I am using a UITabBarController as well as a UINavigationController on my app.

In my UITabBarController I am using more than 5 items so I automatically get the 'More' item. I've managed to add a saving procedure so the order of those items will be kept in case somebody changes the order etc.

With 'More' active I get the More navigation controller with the 'Edit' item positioned under my UINavigationController. Both navigation controller are visible. When I click on 'Edit though the More navigation controller disappears and seem to be hiding under my UINavigationController and therefore I can't see/use the 'Done' function to save my new order

What did I miss?

Cheers

A: 

It sounds like you have a UINavigationController as the main VC of your app, and a UITabBarController as one of the VC's on its stack.

I believe Apple actively discourages people from doing this in their apps, and so do I. It is never done in the iOS itself, and I have never seen it in any third-party apps either, so users will probably be confused.

I think you should embed the UINavigationController inside the UITabBarController instead of the other way around, or you could just choose to use another way of showing what you want to show.

Douwe Maan
Yep I know, in IB I could just drag the UINavigationController onto the UITabBarController. But I am creating my tabs programmatically. So how would I have to do that?
You can just add the `UINavigationController` to the `UITabBarController` via the `viewControllers` property or the `setViewControllers:animated:` method. Both take an `NSArray` of `UIViewController` s.
Douwe Maan
Thanks for that.
How would I add the UINavigationController? [tabs setViewControllers:[NSArray arrayWithObjects:aboutPerson,activities,bookmarks,whiteboard,colleagues,test,nil]];
`[NSArray arrayWithObjects:viewController, anotherViewController, yourInstanceOfUINavigationController, nil]`
Douwe Maan