Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Zvi

macrumors newbie
Original poster
Sep 29, 2008
7
0
Hi All,
I've managed to get programmaticaly created tab bar to display necessary views and navbars. That part is ok. However, initially when the tab bar shows up it has only one out of two buttons visible, second button is there, if I click it app goes to corresponding view and displays it correctly, after that button becomes visible.

Here's the code:

Code:
         tabController = [[UITabBarController alloc] init];

         PjListViewCtl *vc1 = (PjListViewCtl*)[[PjListViewCtl alloc] initWithConMgr:self.connectionMgr style:UITableViewStylePlain];
         UINavigationController *tnv1 = [[[UINavigationController alloc] initWithRootViewController:vc1] autorelease];
         
         
         HiPoListViewCtl *vc2 = (HiPoListViewCtl*)[[HiPoListViewCtl alloc] initWithConMgr:self.connectionMgr style:UITableViewStylePlain];
         UINavigationController *tnv2 = [[[UINavigationController alloc] initWithRootViewController:vc2] autorelease];
         
         
         tabController.viewControllers = [NSArray arrayWithObjects:tnv1,tnv2, nil];

    [window addSubview:tabController.view];    
    [window makeKeyAndVisible];
Each view controller used here is setting tab bar title in init
Code:
self.tabBarItem.title = @TBTTL_STATUS;
For one, tab button always uses the title of the view, which isn't what I need here. If that is the design why have title on tabbaritem?

More importantly why or how to make second button appear on startup?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.