Hi,
I am developing iPad application, which consist of Login screen and once user loged in the next view (UserInformationView) should be a split view. But when I insert the view of SplitView into UserInformationView, it does not display the SplitView.
My sample application is as follows. At first I, insert the split view into application at AppDelegate
MenuViewController *menu = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil];
DetailViewController *detail = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
UISplitViewController *split = [[UISplitViewController alloc] init];
split.viewControllers = [NSArray arrayWithObjects:menu, detail, nil];
[window split.view];
[window makeKeyAndVisible];
Then it works fine showing the splitView on the screen.
In the second step, I added the new UIViewController (UserInformationViewController) and tried to add splitview controller into it as follows.
- (void)viewDidLoad {
MenuViewController *menu = [[MenuViewController alloc] initWithNibName:@"MenuViewController" bundle:nil];
DetailViewController *detail = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
UISplitViewController *split = [[UISplitViewController alloc] init];
split.viewControllers = [NSArray arrayWithObjects:menu, detail, nil];
[self.view addSubview:split.view];
[super viewDidLoad];
But in the second case only detail view is shown in land scape mode, also it has moved to left side too.
Can anybody identify, is there any thing goes wrong in this approach.