Good afternoon everyone. Thanks in advance to anyone who can help with this. I am officially stumped. Here is my problem.
I have a set of 4 tabs with views working great. My app has a second mode, called gameplay mode. In this mode, I want to display 4 completely different tabs with 4 new views. I am trying to find a way to dynamically switch between the two sets of tabs and controllers. Right now I have the follow code:
Code:
[tbc setViewControllers:tc animated:YES];
[tbc setSelectedViewController:[tc objectAtIndex:0]];
tbc is a TabBarController
tc is an NSMutableArray of ViewControllers
However this code simply empties the tab bar, and gives me a blank screen.
I tried including
Code:
[window addSubview:tbc.view];
in there as well, but that was a bust.
I tried adjusting the tabbar items by hand by using
Code:
[[tbc tabBar] setItems:ti animated:YES];
where ti is an array of items. That threw an exception saying this action was not allowed.
Has anyone ever gotten this to work? Has anyone been able to dynamically add a tab and it's controller at runtime? Thanks again for any help given. This has been a surprisingly difficult problem.