0
votes

I'm having issues setting the view outlet of a view controller containing only a UITabBarController. I created this view controller by creating a new file as UIViewController, and dragging in a UITabBarController in IB. When I run my application and try to open the view controller containing this view controller, I get:

-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "RootMenuViewController" nib but the view outlet was not set.

This is because I haven't associated the view of the RootMenuViewController with anything.

The problem I'm trying to wrap my head around it what to associate the view outlet with, because I can't seem to create the outlet to the UITabBarController in IB. Adding a View component creates another window within IB, but associating that results in the Tab Bar not displaying. Any suggestions?

Below is what I see in IB.

screenshot of IB

1

1 Answers

0
votes

I'd just like to update that I technically didn't solve this issue, I just worked around it. My original intention was basically to have a central view controller managing several view controllers, each representing a tab, requiring the use of the Tab Bar Controller.

However, I read somewhere that you don't want to include the Tab Bar Controller element in a regular View Controller XIB file. I don't know whether this was true or not, but it was reason enough for me to try to work around. Instead, I settled on one (and only one) view controller to manage everything, and have that view controller be responsible for the views of each tab, rather than a view controller for each tab.

This allowed me to assign the central view controller to implement UITabBarDelegate, and I simply respond to tab changes and swap views. I had each view sized to fit above the tab bar, and reference its data in the central view controller.