在将spliviewController添加为rootviewcontroller
之后,我需要提供一个登录ViewcontrollerMasterVC *masterViewController = [[[MasterVC alloc] initWithNibName:@"MasterVC" bundle:nil] autorelease];
UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease] ;
masterNavigationController.navigationBar.barStyle=UIBarStyleBlackOpaque;
masterNavigationController.delegate=masterViewController;
Home *detailViewController = [[[Home alloc] initWithNibName:@"home" bundle:nil] autorelease];
UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease];
detailNavigationController.navigationBar.barStyle=UIBarStyleBlackOpaque;
self.splitViewController = [[[UISplitViewController alloc] init] autorelease];
self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil];
self.window.rootViewController=self.splitViewController;
LoginVC *modalLoginView = [[[LoginVC alloc] initWithNibName:@"LoginVC" bundle:nil] autorelease];
[modalLoginView setModalPresentationStyle:UIModalPresentationFullScreen];
[self.splitViewController presentModalViewController:modalLoginView animated:NO];
[self.window makeKeyAndVisible];
return YES;
但是没有显示登录视图。 请提前帮助。谢谢
答案 0 :(得分:0)
尝试在主视图或详细视图的viewDidAppear事件中显示模态视图。 显然appDelegate还没有尝试做UI演示,因为还没有界面。
您还需要将splitViewController的视图作为子视图添加到窗口中。
[self.window addSubView:self.spliViewController.view];