【发布时间】:2014-11-02 13:42:21
【问题描述】:
在我的应用程序开发过程中,我决定从使用 UIStoryboard 更改为 .xib 文件,现在我收到错误消息:
在捆绑包 NSBundle 中找不到名为“Main”的情节提要
如何在我的应用程序的模拟器部分解决此问题?
【问题讨论】:
-
您是否编辑了
Info.plist以删除主情节提要基本文件?
标签: objective-c xcode nsbundle
在我的应用程序开发过程中,我决定从使用 UIStoryboard 更改为 .xib 文件,现在我收到错误消息:
在捆绑包 NSBundle 中找不到名为“Main”的情节提要
如何在我的应用程序的模拟器部分解决此问题?
【问题讨论】:
Info.plist 以删除主情节提要基本文件?
标签: objective-c xcode nsbundle
从 info.plist 文件中删除 "Main storyboard file base name" 或 "UIMainStoryboardFile" 密钥。
【讨论】:
将这些行添加到您的操作方法中
“Main”将与它相同
让 storyboard = UIStoryboard.init(name: "Main", bundle: nil)
让 secondVc = storyboard.instantiateViewController(withIdentifier: "ControllerName") as!控制器名称
present(secondVc, 动画: true, 完成: nil)
【讨论】: