【发布时间】:2018-12-15 07:31:37
【问题描述】:
在多个故事板中工作。从点 A->TabBarController(tab 2)->NavigationControllerA->StoryboardReference->NavigationControllerB->ViewControllerA->ViewControllerB 获取。无需数据传递。
我的标签栏控制器设置在自己的故事板中,每个标签都通过导航控制器到达故事板引用。然后情节提要参考链接到另一个情节提要(obv.),并通过导航控制器链接到 ViewControllerA。然后我想去performSegue到ViewControllerB。这一切都是通过 UIViewController 扩展完成的。 根据我一直在阅读的内容,我应该这样处理:
let tab = 2
let sbOne = UIStoryboard(name: "Main", bundle: nil)
let tabBarController = sbOne.instantiateViewController(withIdentifier: "TabBarController") as! UITabBarController
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window?.rootViewController = tabBarController
tabBarController.selectedIndex = tab
let sbTwo = UIStoryboard(name: "sbTwo", bundle: nil)
let viewControllerA = sbTwo.instantiateViewController(withIdentifier: "ViewControllerA")
performSegue(withIdentifier: "toViewControllerB", sender: self)
我收到 NSInvalidArgument:A 点“没有带有标识符 'toViewControllerB' 的 segue”
【问题讨论】:
标签: swift delegates storyboard viewcontroller tabbarcontroller