XCode deployment error: 'NSInvalidArgumentException', Could not find a storyboard named 'MainStoryboard'

不问归期 提交于 2019-11-28 09:52:00
Ralph Willgoss

I got the following similar error in XCode 4.3.3:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainStoryboard'

I fixed it by doing the following:

  1. Make sure your -info.plist has Main story board file based name = MainStoryboard
  2. Right Click on your Story Board file in Xcode and select Delete then References Only
  3. Right Click on your project and select Add Files to [Your Project]
  4. Navigate to the story board file, found in the en.lproj folder in your projects directory and add it
  5. Clean, Recompile and Run and you should find it works.

Got the idea from this SO post: XCode 4.2 MainStoryBoard Not Found

Just as a reference to other first timers like me reading through all the SO questions about missing storyboards:

Don't put ".storyboard" at the end of your file name in your plist file. It should look like this:

Main storyboard file base name: MainStoryBoard

When you create a new *.storyboard file, Xcode (version to date) doesn't automatically add it into your build resources. To fix this you must add the file under "Copy Bundle Resources".

Select the Xcode project icon and navigate to: Targets > Build Phases > Copy Bundle Resources

Click the + button at the bottom to add the storyboard file.

After cleaning my Projekt i have every time this Problem......

My solution is: move the Main.Storyboard intro trash.

Then "Add Files" select your soryboard, after moving the Main.stpryboard from trash zo your desktop.

and, voila. The Error ist gone.

Considering that there is not too much information about your problem, My best bet would be to go to the package Info, and see if the Main Storyboard is set to whatever your main storyboard is.

As of iOS 9 use just "Main" for storyboard name, worked for me.

radthemad4

Ralph Willgoss's steps didn't work for me. I managed to solve it by copying all the viewcontrollers in the storyboard, deleting it (Move to Trash, not Remove Reference), making a new one (rightclicking the project folder and clicking New File, selecting Storyboard) with the same name as the one I deleted and then pasting the copied contents into it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!