【发布时间】:2023-03-20 15:43:01
【问题描述】:
我正在尝试在我的项目中实现 BWWalkthrough。但是我收到一个错误说明
Unknown class _TtC20BWWalkthroughExample27BWWalkthroughViewController in Interface Builder file.
Could not cast value of type 'UIViewController' (0x195bca580) to 'AppName.BWWalkthroughViewController' (0x10042c3a0).
(lldb)
它指向下面的代码
let walkthrough = stb.instantiateViewControllerWithIdentifier("walk") as! BWWalkthroughViewController
我不知道为什么会这样。任何帮助将不胜感激。
也可以随时向我的项目索要更多代码。
【问题讨论】:
-
您是否在 Interface Builder 中将自定义视图控制器的类显式设置为
BWWalkthroughViewController? -
Swift 还不支持名称删除,所以你会得到:
_TtC20BWWalkthroughExample27BWWalkthroughViewController,这类似于 C++ 名称修改,但几十年前已解决错误消息。 -
有关类似于
_TtC20BWWalkthroughExample27BWWalkthroughViewController的名称的更多信息,请参阅stackoverflow.com/questions/24062957/…
标签: ios swift casting lldb bwwalkthrough