tabBarController = [[UITabBarController alloc] init];
FirstViewController *firstViewController = [[FirstViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *firstNavigationController = [[UINavigationController alloc] initWithRootViewController:firstViewController];
[firstViewController release];
SecondViewController *secondViewController = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
UINavigationController *secondNavigationController = [[UINavigationController alloc] initWithRootViewController:secondViewController];
[secondViewController release];
tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavigationController,secondNavigationController,nil];
[(UITabBarItem *)[tabBarController.tabBar.items objectAtIndex:0] setTitle:@"体检数据"];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
iPhone开发 tabBarController与UINavigationController结合
TAG: