XCode 4.2 MainStoryBoard Not Found

13,119

Solution 1

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:

  1. Right-click on your MainStoryboard.storyboard in the Project Navigator.
  2. Select Delete and click Remove References Only.
  3. Right click on InfoPlist.strings and select "Show In Finder". (This is just my lazy way to open the folder containing the storyboard in finder.)
  4. Drag the MainStoryboard.storyboard from Finder back into the project.

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.

Solution 2

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:

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)'

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!

Solution 3

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.

Solution 4

You could always also reset the simulator.

Share:
13,119
Ashutosh Priyadarshy
Author by

Ashutosh Priyadarshy

Updated on June 30, 2022

Comments

  • Ashutosh Priyadarshy
    Ashutosh Priyadarshy about 2 years

    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.

  • danfelabs
    danfelabs over 12 years
    Yes, This fixed my problem. Thanks.
  • Kelly
    Kelly over 11 years
    Definitely a good way to do it as well! And I like that it avoids removing the file (a chance to accidentally move it to the trash.) This is also a good place to note that some dragged-in source files may not be added to the compilation list too! In that case you would unfold Compile Sources and add the .m or .mm file with the + sign.
  • user14322501
    user14322501 about 11 years
    this doesn't fix it as this problem happens to real devices too
  • user14322501
    user14322501 about 11 years
    I'll have to try this next time I get this error. I'm certain this error is related to localization and the fact that you mention localization as an issue is good for my theory :)
  • user14322501
    user14322501 about 11 years
    this is what I do every time this happens, but I'd like to figure out what causes it every so often
  • horseshoe7
    horseshoe7 about 9 years
    This bug can also happen in Xcode 6. Thanks for the fix! That was it.