第一个ViewController
由NavigationController
管理,并且有一个UIWebView
。 WebView
模块具有点击事件以推送ViewController
中的NavigationController
。
但是现在,按代码初始化的ViewController
是正常的,init
storyboard
的{{1}}异常,navigation bar
消失了。它仅发生在iOS8及更早版本中。
PS:初始化代码是这样的:
代码:
ViewController *vc = [[ViewController alloc]init];
[self.navigationController pushViewController:vc animated:YES];
故事板:
ViewController *vc = [ViewController defaultViewControllerWithStoryboard:@"StoryboardName"];
[self.navigationController pushViewController:vc animated:YES];
谢谢。
答案 0 :(得分:0)
MainViewController* presentController = [self.storyboard instantiateViewControllerWithIdentifier:@"StoryBoardidentifier"];
[self.navigationController pushViewController:presentController animated:YES];
如果它不起作用,请尝试通常yourStoryBoardName是Main:
UIStoryboard* storyBoard = [UIStoryboard storyboardWithName:@"YourStoryBoardName" bundle:nil];
MainViewController* presentController = [storyBoard instantiateViewControllerWithIdentifier:@"StoryBoardIdentifier"];
[self.navigationController pushViewController:presentController animated:YES];