Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
731 views
in Technique[技术] by (71.8m points)

iphone - Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle

I have started a new app a few days ago and began working with the simulator to test it. I started as an empty project and manually added the storyboard. The simulator builds and runs my app just fine but when I try to build to my iPhone I get the messsage 'Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle'.

Google turned up nothing and this question suggested I checked my target for the storyboard, but everything is in place. Even so, if something wouldn't be in place, the simulator wouldn't run either.

Can anyone point me in the right direction?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had my app working normally on the iPhone Simulator but strangely Xcode stopped responding and i had to Force Quit Xcode. When I restarted Xcode i encountered "Could not find a storyboard named MainStoryboard....",

I have fixed this issue by following below steps:

  1. Renaming "MainStoryboard.storyboard" to "MainStoryboard_1.storyboard"
  2. Open file "$your_app$-Info.plist" located in "Supporting Files" folder. Edit "Main storyboard file base name" to "MainStoryboard_1.storyboard".
  3. Rerun the app, and it worked for me.
  4. I renamed my storyboard file back to its original "MainStoryboard.storyboard".
  5. Edited the .plist file back to its original.
  6. Rerun the app, and it worked for me.

For some reason the file "MainStoryboard.storyboard" was not recognised after force quitting Xcode and following above steps made the app recognise the file back again.

Hope this solution helps..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...