无法转换类型为'UIViewController'的值

Sat*_*uki 5 casting ios swift bwwalkthrough

我正在尝试在我的项目中实现BWWalkthrough。但是我得到一个错误说明

Unknown class _TtC20BWWalkthroughExample27BWWalkthroughViewController in Interface Builder file.
Could not cast value of type 'UIViewController' (0x195bca580) to 'AppName.BWWalkthroughViewController' (0x10042c3a0).
(lldb) 
Run Code Online (Sandbox Code Playgroud)

它指向下面的代码

let walkthrough = stb.instantiateViewControllerWithIdentifier("walk") as! BWWalkthroughViewController
Run Code Online (Sandbox Code Playgroud)

我不知道为什么会这样,感谢您的帮助,谢谢。

也可以随时从我的项目中询问更多代码。

saa*_*jha 5

您的情节提要似乎未链接到BWWalkthroughViewController。找到视图控制器应该在哪里BWWalkthroughViewController,然后检查它是否是一个。


nob*_*ada 5

我有同样的问题。

我可以修复在我的漫游故事板中设置 BWWalkthroughViewController,而不是 BWWalkthroughPageViewController。

在此处输入图片说明