Hi -
I have an an iPhone app I'm building. The first two screens are navigation controllers but starting from the third screen on, I want a UITabBarController with three navigation controllers inside. I'm able to code the UITabBarController by hand (not using interface builder) and all works fine except that when I transition to the UITabBarController screen, it does not animate. I really want it to animate.
Here is the code of the UITabBarController page:
- (void)viewDidLoad {
window = [[UIApplication sharedApplication] keyWindow];
self.navigationItem.title = @"Main Screen";
viewController1 = [[MainPageController alloc] initWithNibName:@"MainPageController" bundle:nil];
viewController1.title = @"Main Page";
UINavigationController *navController1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
viewController2 = [[educationTab alloc] initWithNibName:@"educationTab" bundle:nil];
viewController2.title = @"History";
UINavigationController *navController2 = [[UINavigationController alloc] initWithRootViewController:viewController2];
educationTab *viewController3 = [[educationTab alloc] initWithNibName:@"educationTab" bundle:nil];
viewController3.title = @"Education";
UINavigationController *navController3 = [[UINavigationController alloc] initWithRootViewController:viewController3];
tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:navController1, navController2, navController3, nil];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
[viewController1 release];
[viewController3 release];
[navController1 release];
[navController2 release];
[navController3 release];
[super viewDidLoad];
}
And of course I'm just doing a simple pushViewController:animated: to have it appear.
StartPageController *startPage = [[StartPageController alloc] initWithNibName:@"StartPageController" bundle:nil];
[self.navigationController pushViewController:startPage animated:YES];
I've tried everything I can think of to make this transition animate. I've moved the UITabBarController creation into initWithNibName, removed the view controller release statements, I've tried creating the page using interface builder, but nothing.
Is what I'm trying to do not appropriate? Should I not be transitioning to a tabbed interface in the middle of an app? I know one app that does this and it appears they just cover over the tabbar in the first screen with an ad. I guess I could go that route if I need to.
Thanks!
Jon