5

I've been working on a application for a long time now and out from the blue i got this:

"Could not find a storyboard named 'MainStoryboard' in bundle NSBundle"

I've red the similar questions here on StackOverflow and i tried everything including: - Renaming the storyboard file - Re-adding the storyboard file - Cleaned the project - Reset contents and setting on the simulator

I've also checked the plist file and the Copy Bundle Resources and the storyboard name is as it should be. Nothing of this works.

I'm developing the application with a friend and we are using Git. The weird thing is that the same version works just fine for him.

However, in the Copy Bundle Resources the MainStoryboard.storyboard and InfoPlist.strings are red. But they have been red for a long time without any troubles. And my friend (for which the project works fine) they are also red.

enter image description here

Ideas?

Rohit_RK
  • 405
  • 4
  • 12
Michael
  • 791
  • 3
  • 10
  • 23

4 Answers4

15

I would suggest to check that this file is not localized (with no actual localization), to remove the localization and to re-add the file.

If this does not work, have you tried to clone a fresh copy of the project from Git?

MonsieurDart
  • 6,005
  • 2
  • 43
  • 45
  • I removed the localization and added it again. Now it works. Thanks! – Michael Apr 12 '13 at 07:31
  • This bug held me up for 2 hours. I doubted that this would resolve it, but finally gave up and tried. It worked. Thanks a ton. – androidnotgenius Jul 29 '13 at 00:57
  • I really hope Xcode 5 will improve this: Xcode 4 often has issues with keeping track of the files of the project. Often need to re-added those files. What a waste of time! – MonsieurDart Aug 21 '13 at 09:12
  • Don't get your hopes too high MonsieurDart; I'm here for a reason :( – Remy Vanherweghem Sep 06 '13 at 04:30
  • 2
    I'm an uncompromising optimist. ;-) – MonsieurDart Sep 11 '13 at 11:24
  • +1, Thanks MonsieurDart. Seems in XCode 5/iOS 7, there's an Apple-side assumption there is no need to support iOS 5. If someone changes the Build Settings, sets architecture away from Arm64 in order to support iOS 5, that is proper for iOS 5. But what doesn't work is that damned silent automatically localized storyboard. Once again, I've learned my lesson not to trust default settings, in IB. – Tom Pace Jan 12 '14 at 05:31
  • I should correct myself: I'm unfamiliar with what is different between iOS 5 and 6 as far as Storyboard localizations. It's probably a good improvement, and it would make sense if I looked into it further, but it's just a huge pain to stumble over for hours. SO to the rescue! – Tom Pace Jan 12 '14 at 05:43
4
  • Select the MainStoryboard.storyboard, from under the project, located in the left panel of the XCode
  • Click the File inspector, on the right side of the XCode.
  • Check the box for Project Target under Target Membership.
  • Do the same for infoplist.strings
  • Clean the project and run it.

OR

  • Remove the files from Copy Bundle Resources
  • Add those two file by clicking + sign.
  • Clean the project and run it.
x4h1d
  • 6,042
  • 1
  • 31
  • 46
4

For what it's worth, I've just had this problem with a fresh project in Xcode 5, trying to set the deployment target back to 5.0. The empty Utility Application would start up fine on simulator on iOS 6+, but would crash with above warning on iOS 5.0/5.1.

Selecting the storyboard in the Project Navigator and File Inspector tab, I found the 'English' icon was plain and unchecked. I checked it:

enter image description here

then clicked on 'Localizable strings', whence I got an alert: enter image description here

After converting, File Inspector looks like this:

enter image description here

and the app no longer crashes. The Project Navigator now shows both Base and English storyboards:

enter image description here

I will leave to someone more knowledgeable to explain what's going on here and what are the consequences of losing the 'Localizable strings' in favour of a proliferation of storyboards...

cate
  • 600
  • 7
  • 15
  • Worked for me but to make it so I needed to choose "Interface builder cocoa touch storyboard" after clicking on 'Localizable strings'. I wasn't sure I needed that but after I did I git the warning you mentioned and with trepidation clicked convert and YAY! now my app runs on an iPad 1 running ios 5.1.1 – sdjuan Aug 25 '14 at 05:14
1
  1. Go to build phases in your app.
  2. click on 'Copy Bundle Resources'
  3. Find your main storyboard file if not than click on '+' icon in bottom and add your main storyboard file to it.
  4. Now run the project again.
KAR
  • 3,303
  • 3
  • 27
  • 50