Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
//put all the views into this array that you want in the tab bar:
NSMutableArray *tabBarViewControllers = [[NSMutableArray alloc] init];
UINavigationController *navigationController;
//Create sales records view,navigation controller and add to array
FirstViewController *tableviewcontroller = [[FirstViewController alloc]
initWithStyle:UITableViewStyleGrouped];
navigationController = [[UINavigationController alloc] init];
navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
[navigationController pushViewController:tableviewcontroller animated:NO];
[tableviewcontroller release];
[tabBarViewControllers addObject:navigationController];
[navigationController release];
//Create view and add to array
FirstViewController *vc = [[FirstViewController alloc]
initWithNibName :nil bunle:nil];
[tabBarViewControllers addObject:vc];
[vc release];
//Create the tab bar controller and add the views you created above
UITabBarController *tabBarController = [[UITabBarController alloc] init];
[tabBarController setViewControllers:tabBarViewControllers animated:NO];
[tabBarViewControllers release];
//Add the tab bar view to the window
[window addSubview:tabBarController.view];
// Override point for customization after application launch
[window makeKeyAndVisible];
}