无法在捆绑包中找到名为“Main”的故事板,Xcode 7 [英] Could not find a storyboard named 'Main' in bundle, Xcode 7
问题描述
升级到XCode 7后,我的项目遇到了麻烦。当我运行时出现错误,由于未捕获的异常终止应用程序'NSInvalidArgumentException',原因:'无法在捆绑包中找到名为'Main'的故事板一个NSBundle。我的故事板名称是Main.storyboard。
I'm having troubles with my project after upgrading to XCode 7. When I run I get an error, "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle". My storyboard name is Main.storyboard.
如果我清理我的项目它运行得很好。我必须每次运行时都要清理,否则我将收到上述错误。
If I clean my project it runs just fine. I must clean each time I run or I will get the above error.
如果发现有相同错误的多个帖子。各种补救措施似乎随机地帮助了一些人而不是其他人。到目前为止,我已经尝试了以下内容。
If found a number of postings with this same error. The various remedies seem to randomly help some people but not others. So far I have tried the following.
- 删除info.plist文件中对storyboard的引用。当我这样做时,应用程序确实启动但我得到一个黑屏,因为它没有加载故事板。
- 摆弄目标成员资格Main.storyboard。
- 从项目中删除故事板,清理,运行然后再添加故事板。
- 卸载Xcode,重新安装Xcode。
- 删除派生数据文件夹。
- 使用UIStoryboard等代码手动加载Storyboard * storyboard = [UIStoryboard storyboardWithName:@Main包:[NSBundle mainBundle]];
- Removing the reference to the storyboard in the info.plist file. When I do this the app does start but I get a black screen as it doesn't load the storyboard.
- Fiddle with the Target Membership Main.storyboard.
- Remove the storyboard from the project, clean, run and then adding the storyboard back again.
- Uninstall Xcode, reinstall Xcode.
- Deleting the Derived Data folder.
- Loading the Storyboard manually with code such as UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
当我手动加载故事板时,它会像使用自动加载一样消息崩溃。
When I load the storyboard manually it crashes with the same messages as autoloading it.
I在升级之前保存了我的工作XCode 6项目的副本,在对我的项目进行了大量工作后,我尝试使用正在运行的XCode 6项目的新副本,但这没有帮助。
I saved a copy of my working XCode 6 project before the upgrade and after fussing so much with my project I have tried using a fresh copy of the XCode 6 project that was working but this didn't help.
我看过很多关于这个问题的帖子,这个人刚刚放弃并重建了他们的项目CH。我希望避免这种情况。
I've seen a number of posts about this problem where the person just gave up and rebuilt their project from scratch. I'm hoping to avoid this.
推荐答案
你能试过吗
选择目标 - > 常规 - > 部署信息 - > 主界面选择您的故事板名称
Select Target - > General -> Deployment info - > Main interface "Choose your Storyboard name"
这可以帮助你
这篇关于无法在捆绑包中找到名为“Main”的故事板,Xcode 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!