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
1.7k views
in Technique[技术] by (71.8m points)

ios - Could not find a storyboard named 'Main' in bundle, Xcode 7

I'm having troubles with my project after upgrading to XCode 7. When I run I get an error, "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle". My storyboard name is Main.storyboard.

If I clean my project it runs just fine. I must clean each time I run or I will get the above error.

If found a number of postings with this same error. The various remedies seem to randomly help some people but not others. So far I have tried the following.

  1. Removing the reference to the storyboard in the info.plist file. When I do this the app does start but I get a black screen as it doesn't load the storyboard.
  2. Fiddle with the Target Membership Main.storyboard.
  3. Remove the storyboard from the project, clean, run and then adding the storyboard back again.
  4. Uninstall Xcode, reinstall Xcode.
  5. Deleting the Derived Data folder.
  6. Loading the Storyboard manually with code such as UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];

When I load the storyboard manually it crashes with the same messages as autoloading it.

I saved a copy of my working XCode 6 project before the upgrade and after fussing so much with my project I have tried using a fresh copy of the XCode 6 project that was working but this didn't help.

I've seen a number of posts about this problem where the person just gave up and rebuilt their project from scratch. I'm hoping to avoid this.

My projects info.plist file

See Question&Answers more detail:os

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

1 Answer

0 votes
by (71.8m points)

Can you tried

Select Target - > General -> Deployment info - > Main interface "Choose your Storyboard name"

May this help you


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

...