问题
After update Xcode to 7 version, can't build my application. This error is every time when I build in simulator's other versions, and device. After clean project I can run on device, but if I want run again, the error is back.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle </private/var/mobile/Containers/Bundle/Application/43A262C3-81D4-4CF3-B727-AE670906234E/someexample.app> (loaded)'
*** First throw call stack:
(0x1852b422c 0x196f280e4 0x18a2f26b0 0x189fbdd48 0x189fbcee0 0x189fbb578 0x18daf53c8 0x18526bfc8 0x18526b0d0 0x1852696f4 0x185194f74 0x189d9c224 0x189d96d94 0x10016854c 0x1975d2a08)
libc++abi.dylib: terminating with uncaught exception of type NSException
I try to delete from targets "Main Interface" and hardcoding like this in AppDelegate
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
ViewController *yourController = (ViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"StartVC"];
self.window.rootViewController = yourController;
and I have another error like can't find storyboard ID StartVC
Have u that problem too?
UPD:
Try to create new storyboard and put in Main interface and get same error
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Storyboard' in bundle NSBundle
UPD 2
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/devBot/Library/Developer/CoreSimulator/Devices/5018D9C0-9609-4368-A72C-488C67EBEFB5/data/Containers/Bundle/Application/9E485D40-7ED4-4996-942B-81A7C9E4DCA9/someapp.app> (loaded)' with name 'StartVC' and directory 'Main.storyboardc''
UPD 3
In Xcode 6.4 all works fine! I think this is bug in Xcode 7
回答1:
Got this problem with Xcode 7 using storyboard references. Probably a solution :
- Fix the localisation to be the same for each storyboard in your file inspector (Base, English...). It's probably a problem with the bundle.
回答2:
Sometimes this happens because the target membership in File Inspector in storyboard is unchecked. Make sure you have that value checked.
回答3:
This suddenly started happening to me, looks like a bug in Xcode 7. I fixed it (possibly only temporarily) by compiling to the iPhone 6 simulator instead of the 6s. We'll see if that is a permanent fix.
To recover, I had to clean the build folder and restart (Quit) Xcode. That solved the problem on 6s for a few compiles.
回答4:
As an added potential answer, my issue was that my "base.lproj" folder name in the application had a lower case first letter, but Xcode was expecting an uppercase first letter "Base.lproj".
Apparently at some point that got changed ( i could see the casing change in my git change)
I had to edit the project.pbxproj file to replace every occurence of "base" with "Base"
回答5:
If you use [NSBundle mainBundle]
just change it to nil. Please check my answer in other thread.
来源:https://stackoverflow.com/questions/32634866/xcode-7-could-not-find-a-storyboard-named