Quote:
Originally Posted by Parental
I want to do something like iPad Youtube app. I think that apple use their custom class and not splitviewcontroller.
|
Ah, yes in that app I remember the TabBarController on the bottom and there is at least one splitview controller in one of the screens.
Personally, I think it would be easier to do it in code.
You can create a Nib with the TabBarController at the bottom and put a viewController for one of the tabButton selections. In the ViewController code setup, I would code the creation of the splitviewController
It really is as simple as creating an array with two viewControllers, the first for the left side the second for the detail, put them in the array and assign it to the splitviewcontroller.
Here is the code I used to create a splitviewcontroller
Code:
-(void)setupAppContainerView {
MyVideoDrawerViewController *drawerController = [[MyVideoDrawerViewController alloc]
initWithNibName:@"MyVideosDrawerView"
bundle:nil];
//Figure out a way to decouple this Delegation, Notification, Observer
appContainerViewController.myVideoDrawerViewController = drawerController;
drawerController.appContainerViewController = appContainerViewController;
NSMutableArray *drawers = [appContainerViewController loadFirstData];
drawerController.drawers = drawers;
//[drawers release];
UINavigationController *rootNav = [[UINavigationController alloc]
initWithRootViewController:drawerController];
[drawerController release];
appContainerViewController.navigationController = rootNav;
DetailViewTableViewController *detailViewController = [[DetailViewTableViewController alloc]
initWithNibName:@"DetailViewTableView"
bundle:nil];
appContainerViewController.detailViewController = detailViewController;
detailViewController.appContainerViewController = appContainerViewController;
appContainerViewController.viewControllers = [NSArray arrayWithObjects:rootNav, detailViewController, nil];
[rootNav release];
[detailViewController release];
}
This also includes a complete navigation controller for the left side, which with IB is difficult to setup.
Hope that helps.
Mark