10

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.

  • Maybe your main storyboard file is missing the bundle. Take a look at Target (left pane, clikc on the top most icon of your app, and then select Target from the right pane) > Building Phases > Copy Bundle Resources. Your main storyboard should be listed there. If it is not there, added by clicking on (+) button. – Sierra Alpha Feb 02 '12 at 14:19
  • Go into your project summary and make sure that the storyboard is set to your storyboard's file name. – tarheel Feb 02 '12 at 16:08
  • I've actually checked both of these things, and they're both as they should be. Any other ideas? – Ashutosh Priyadarshy Feb 03 '12 at 19:39

5 Answers5

34

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.

Kelly
  • 1,096
  • 12
  • 22
4

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!

Nico
  • 41
  • 1
  • 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 :) – Brenden May 20 '13 at 21:35
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.

Leon
  • 410
  • 2
  • 14
  • 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. – Kelly Jan 03 '13 at 22:46
1

You could always also reset the simulator.

Linuxios
  • 34,849
  • 13
  • 91
  • 116
user123
  • 2,711
  • 5
  • 21
  • 25
0

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.

Charles Robertson
  • 1,760
  • 16
  • 21