故事板不包含带有标识符的视图控制器“ sidemenucontroller”

发布于 2025-01-19 23:57:12 字数 647 浏览 2 评论 0原文

信息:

终止由于未知的例外“ nsinvalidargumentException”,原因是:'故事板(< uistoryboard:0x6000036306c0>)不包含带有标识符的“ homeviewController”''

'

'

我尝试将side菜单视图添加到MAIRVIEW CONDORLOLLER中这样做。

代码:

guard UIStoryboard(name: "MainViewController", bundle: nil).instantiateViewController(withIdentifier: "SideMenuViewController") is SideMenuViewController else {
    fatalError("Unable to Instantiate Quotes View Controller")
}

我设置了所有标识符,它们起作用,但是只有代码的那部分行不通。 我尝试过:清洁建筑文件夹,设置另一个标识符,使用另一个故事板,没有任何帮助。

“在此处输入图像说明”

Message:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard (<UIStoryboard: 0x6000036306c0>) doesn't contain a view controller with identifier 'HomeViewController''

I try to add side menu view to my MainViewController and get an error while doing that.

Code:

guard UIStoryboard(name: "MainViewController", bundle: nil).instantiateViewController(withIdentifier: "SideMenuViewController") is SideMenuViewController else {
    fatalError("Unable to Instantiate Quotes View Controller")
}

I set all identifiers and they work, but only that part of code doesn't work.
I tried: clean building folder, set another identifier, use another storyboard and nothing helps.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文