0

I'm writing a UITabBar application and I want the views to have a UINavigation on one of the views. Normally I would set the rootViewController to a UINavigationn controller but the TabBarController is set to the rootViewController. How do I add a UINavigation controller to one view? Thanks for the help.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
user1681673
  • 368
  • 1
  • 6
  • 28

1 Answers1

2

You simply make the nav controller the root of the given tab.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
  • I tried this but it didn't work. I'll play with it some more and see what happens. Thanks for the help. – user1681673 Jun 23 '13 at 19:43
  • I should mention, the view's class I want the navigation controller in is UITableViewController. Does that change anything? – user1681673 Jun 23 '13 at 20:24
  • No. You create your view controller. Then create a nav controller passing the view controller as the root of the nav controller. Then pass the nav controller as one of the view controllers used by the tab bar controller. – rmaddy Jun 23 '13 at 20:26
  • Is that done in the appDelegate? – user1681673 Jun 23 '13 at 21:02
  • That depends on whether you use Interface Builder or do it all programmatically. If you do it in IB, set it all up in IB. If you do it all in code, then create the nav controller in the same place you create all of the view controllers and the tab controller. – rmaddy Jun 23 '13 at 21:08
  • Thanks for the help, I really appreciate it. I used IB to set everything up. Do I need to add a navigationController to the XIB? I tried and it won't let me. – user1681673 Jun 23 '13 at 21:50