我曾经将所有 View Controller 都放在同一个 Storyboard中,我认为拆分 Storyboard是有意义的,所以我创建了一个新的 Storyboard文件 New File -> User Interface -> StoryBoard
,剪切所有与用户管理相关的 Controller (登录、注册、密码恢复...)并将它们粘贴到新文件中
现在,当我调用 storyboard.instantiateViewControllerWithIdentifier("LoginViewController")
时,它崩溃并出现以下错误:
'Storyboard (<UIStoryboard: 0x...>) doesn't contain a view
controller with identifier 'LoginViewController''
我该如何解决?
最佳答案
我认为您的问题出在这里,然后导航至 Main.storyBoard,然后单击您要启动的 viewController,然后将其提供给此处的标识符:
也许这会对你有所帮助。
关于ios - Storyboard不包含带有标识符的 View Controller ......使用多个 Storyboard文件时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27357236/