XCode 4.2 MainStoryBoard 未找到
当我对 MainStoryboard.storyboard 进行更改时,即使构建了,这些更改也不会传递到我的 iOS 设备上。我尝试从设备中删除应用程序的所有数据并重新启动所有内容,但现在当我在 iPhone 上构建并运行代码时,出现以下错误:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle </var/mobile/Applications/BE0CBEE9-1E95-443A-97CF-53CCD66A2D0C/WalkBack.app> (loaded)'
据我所知,我的 plist 文件包含有关应用程序名称的适当信息。故事板。
任何想法出了什么问题,或者我该如何解决它?当这个问题发生时,.xcodeproj 文件开始在 XCode 3 中打开。这是否搞乱了一些设置?我非常迷失。
When I make changes to the MainStoryboard.storyboard none of these changes make it to my iOS device even though it builds. I tried deleting all data for the application from the device and restarting everything but now when I build and run the code on the iPhone I get the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard' in bundle NSBundle </var/mobile/Applications/BE0CBEE9-1E95-443A-97CF-53CCD66A2D0C/WalkBack.app> (loaded)'
From what I can tell, my plist file has the appropriate information for the name of the storyboard.
Any ideas what is wrong, or how can I fix it? Right when this problem happened the .xcodeproj file started opening in XCode 3. Did this mess up some settings? I'm terribly lost.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我在学生的文件中见过这种情况发生过几次,今天我也遇到了这种情况。似乎可以解决这个问题:
我怀疑向项目添加文件或对故事板进行某些编辑会触发某个地方的错误。它会导致本地化文件无法复制到捆绑包中(我认为)。删除故事板并将其重新添加到项目中似乎可以解决这个问题。
I've seen this happen a handful of times with the files with my students, and today I had it happen to me as well. What seems to fix it for me:
My suspicion is that there is a bug somewhere triggered by adding files to the project or certain edits to the storyboard. It causes the localized files to not be copied into the bundle (I think). Removing the storyboard and re-adding it to the project seems to fix the hiccup.
我有通用应用程序,因此使用一个用于 iPhone 的故事板和另一个用于 iPad 的故事板,iPad 模拟器可以工作,但是当我尝试午餐 iPhone 模拟器时,我收到此错误:
我尝试了所有解决方案,但没有人工作。我总是有同样的错误。
我解决了删除 iPhone Storyboard 上的本地化参数并为两个 Storyboard 设置相同本地化的问题。
我希望这对你有帮助!
I have universal app, so with one storyboard for iPhone and another one for iPad, iPad simulator works, but when i try to lunch iPhone simulator i obtain this error:
I tried all your solutions but anyone didn't work. I always had same error.
I solved removing localization parameter on iPhone storyboard and setting for both storyboard the same localization.
I hope that helps you!
还有另一种方法!
转到您的项目,选择您的目标,然后单击构建阶段。
然后展开“复制捆绑资源”并将MainStoryboard.storyboard添加到资源中。
您可以通过单击展开列表底部的小“+”号来完成此操作。
您不必从项目中删除该文件,只需将其重新添加到资源中即可。
There is another way!
Go to your project, select your target and click on Build Phases.
Then unfold "Copy Bundle Resources" and add the MainStoryboard.storyboard to the resources.
You can do this by clicking on the little '+' sign on the bottom of the unfolded list.
You don't have to delete the file from your project just re-add it to the resources.
您也可以随时重置模拟器。
You could always also reset the simulator.
实际上,更准确地说,您会发现无法将 MainStoryboard.storyboard [它不会显示在文件浏览器中] 添加到构建阶段设置的“复制捆绑资源”部分。我发现我实际上必须将其添加到构建阶段设置的“编译源”部分。然后将其添加到两个部分。我不确定这是否是 Xcode 4.6.3 中的预期行为或错误。
Actually, to be even more precise, you will find that you are unable to add MainStoryboard.storyboard [it does not show up in the file browser] to the "Copy Bundle Resources" section of the Build Phase setting. I found that I actually had to add it the "Compile Sources" section of the Build Phase setting. It then adds it to both sections. I am not sure whether this is the intended behaviour or a bug in Xcode 4.6.3.