12

I cannot run my project in simulator because i get this error:

Could not find a storyboard named 'MainStoryboard_iPad'

But the storyboard is there. Thank you

Andreas
  • 397
  • 4
  • 18
  • 37

8 Answers8

39

I managed to solve this problem in my iPad App through the following steps:

  1. Checking the Build Phases
  2. Editing the Info.plist file to add the option "Main storyboard file base name (iPad)"

Just like in this picture: resposta.jpg

Daniel Lima
  • 798
  • 8
  • 13
12

In my case, the iPad storyboard file was already in the project, and testing the app worked until I introduced what seems to be an unrelated bug... I fixed this by changing the filename in xCode for the MainStoryBoard_iPad to MainStoryBoard_iPad1 and changing the TARGETS > Summary > iPad deployment Info > Main Storyboard entry. For good measure also verifying the same in -Info.plist file and Build Phases accordingly... similar to @daniel-lima.

Hopefully, this may help others that did not fix based on above notes. This started after I fixed a CoreData related bug in a category-file. The issue was reproducible on another machine... and this fixed it on both machines.

vmanjz
  • 1,156
  • 1
  • 10
  • 23
  • This is a very odd bug indeed. I added the '1' to the name and changed the settings. That fixed everything. I then removed the '1' and built again. Runs smooth after the quick name change. Thanks a lot. +1 – atreat Mar 23 '12 at 17:49
8

My issue was only on iOS 5. The resolution was found at http://need-bee.com/b/2013/08/could-not-find-a-storyboard-in-xcode-5-for-ios-5-0/

To summarize: In Xcode, open each story board file and uncheck "Base" under localization on the right hand side. It will prompt you to move to English. Select ok. Once rebuilt my issue was resolved.

Joseph Lennox
  • 3,202
  • 1
  • 27
  • 25
5

Click target and there is Mainstoryboard with textfield. Click and select your storyboard named "Mainstoryboard_iPad" and clean your project and then run it.

Dinesh Raja
  • 8,501
  • 5
  • 42
  • 81
1

Remove from the project all the StoryBoards and add all of them again, for me worked.

Gustavo
  • 785
  • 1
  • 12
  • 31
  • I think that *how* you *add* the storyboard is the key. It seems that I *caused* the problem by assuming I could drag .storyboard into a project, same as I have been dragging source files in for years. To *fix* the problem, I re-named the dragged .storyboard file in the Project Navigator, which also renames it in Finder. Then I did File > New > File > Storyboard and created a new, empty storyboard with the original name. Finally, in Finder, I trashed this new empty .storyboard file, and renamed the original file back to its original name, replacing it. Rebuilt, and it worked. – Jerry Krinock Aug 23 '14 at 16:52
1

I got this problem today as well, for me, a Product > Clean solved the problem. After that, I can rebuild the app and run it inside the Simulator without any issue.

vinhkhoa
  • 53
  • 7
1

I was encountering the same problem as in the original question but for me there wasn't really a bug - rather, the storyboard which appeared in the project navigator as "Main.Storyboard" actually had a base name of "Main" in info.plist. So my attempts to use "MainStoryboard" and "Main.Storyboard" in my code were generating a crash, but once I changed it to "Main" it worked just fine - didn't need any of the elaborate workarounds above.

Danny
  • 439
  • 5
  • 9
1

If the failure occurs after launch, check to make sure any references to a storyboard via storyboardWithName: refers to the correct name. You may have an incorrect name hardcoded in your binary.

In my case, I renamed the storyboard (based on a suggested workaround on stack overflow), but forgot to rename references to the storyboard in code. The symptoms were that changes to the storyboard weren't visible in the running application, but once I reset the simulator, the app stopped working completely. In that case, the old, stale copy of the storyboard was around at first and was used; once the simulator was reset, the stale copy disappeared and the "could not find a storyboard" message started appearing.