I am trying to make something similar (but not quite) the email application found on the iPad .
In particular, I would like to create a tab-based application , but each tab would introduce a different UISplitView to the user .
Each UISplitView contains a "Master and Part" view (obviously).
In each UISplitView, I would like the Wizard to be a multi-level navigation controller, where new UIViewControllers are pushed onto the stack or popped out of it. This type of navigation in UISplitView is an application similar to a native email application.
As far as I know, the only place where a decent "splitviewcontroller inside the uitabbarcontroller" is described is here: UISplitViewController in TabBar (UITabBarController)? and I tried to follow the accepted answer.
The decision made works for me (i.e. I get a tab controller that allows me to switch between different UISplitViews).
The problem is that I do not know how to make the left side of the UISplitView a multi-level navigation controller.
Here is the code that I used in my application delegate to create the initial “split view” inside the “tab bar controller” (this is pretty much as suggested in the above link).
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSMutableArray *tabArray = [NSMutableArray array];
NSMutableArray *array = [NSMutableArray array];
UISplitViewController *splitViewController = [[UISplitViewController alloc] init];
MainViewController *viewCont = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
[array addObject:viewCont];
[viewCont release];
viewCont = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
[array addObject:viewCont];
[viewCont release];
[splitViewController setViewControllers:array];
[tabArray addObject:splitViewController];
[splitViewController release];
array = [NSMutableArray array];
splitViewController = [[UISplitViewController alloc] init];
viewCont = [[Master2 alloc] initWithNibName:@"Master2" bundle:nil];
[array addObject:viewCont];
[viewCont release];
viewCont = [[Slave2 alloc] initWithNibName:@"Slave2" bundle:nil];
[array addObject:viewCont];
[viewCont release];
[splitViewController setViewControllers:array];
[tabArray addObject:splitViewController];
[splitViewController release];
[tabBarController setViewControllers:tabArray];
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
return YES;
}
MainViewController - UIViewController, :
- (IBAction)push_me:(id)sender {
M2 *m2 = [[[M2 alloc] initWithNibName:@"M2" bundle:nil] autorelease];
[self.navigationController pushViewController:m2 animated:YES];
}
( ) UIButton, MainViewController.xib. , (push_me) UIViewController ( m2) m2 UIButton . , ( , ).
, ?
!