TabBarController inside the RootViewController of the SplitViewController

I would like to develop an iPad application that will consist of SplitViewController. I would like to add TabBarControllerto the RootViewController.

I am at the very beginning of development. So I started just creating a new project, adding SplitViewControllerthrough Interface Builderand testing the application, no problem. Then I tried adding TabBarControllerto RootView, no problem through Interface Builder. The problem is that I cannot get the application to spin with the device. I assume that I need to change something in the code, but I don’t know that :-( I noticed that the method is shouldAutorotateToInterfaceOrientationnever called when the device rotates. Sorry to ask this question, but I am very new to developing applications for iPad / iPhone.

Regards

0
source share
1 answer
UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:annualViewController];
[navigationController1.navigationBar addSubview:imageView1];
[list addObject:navigationController1];
[imageView1 release];

UINavigationController *navigationController2 = [[UINavigationController alloc] initWithRootViewController:rootViewController];
UIImageView *imageView2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"navigation bar.png"]];
imageView2.frame = CGRectMake(0, 0, 320, 44);
[navigationController2.navigationBar addSubview:imageView2];
[list addObject:navigationController2];
[imageView2 release];

tabBarController.viewControllers=list;

detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil];
rootViewController.detailViewController = detailViewController;
annualViewController.detailViewController=detailViewController;

splitViewController = [[UISplitViewController alloc] init];
splitViewController.viewControllers = [NSArray arrayWithObjects:tabBarController, detailViewController, nil];
splitViewController.delegate = detailViewController;

// Add the split view controller view to the window and display.

[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
+1
source

All Articles