[英]Why a storyboard contain a UITabBarController can't present another storyboard/
有關的代碼提供了另一個獨立的故事板,如下所示:
- (IBAction)action:(id)sender {
UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:@"SecondStoryboard" bundle:nil];
UIViewController *firstVC = [secondStoryboard instantiateViewControllerWithIdentifier:@"22"];
[self.navigationController presentViewController:firstVC animated:YES completion:nil];
}
如果我的后續故事板包含一個UITabBarController
的Pesentbutton,其功能為-(IBAction)action:(id)sender;
無法呈現另一個獨立的故事板。
如果我的以下故事板包含一個UINavigationController
該Pesentbutton具有-(IBAction)action:(id)sender;
按預期呈現另一個獨立的故事板。
誰能告訴我原因呢?謝謝!
因為在第一種情況下, self.navigationController
為nil ...因為不存在導航控制器。 嘗試從self
或self.tabBarController
呈現
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.