Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode 4.2 MainStoryBoard Not Found

Tags:

ios

storyboard

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.

like image 696
Ashutosh Priyadarshy Avatar asked Feb 02 '12 13:02

Ashutosh Priyadarshy


3 Answers

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.

like image 164
Kelly Avatar answered Oct 23 '22 07:10

Kelly


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!

like image 4
Nico Avatar answered Oct 23 '22 05:10

Nico


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.

like image 3
Leon Avatar answered Oct 23 '22 06:10

Leon