在更新了Xcode到7版本之后,我不能构建我的应用程序。每次在模拟器的其他版本和设备上构建时都会出现这个错误。在清理项目后,我可以在设备上运行,但如果我想再次运行,错误就会出现。
*** 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
我尝试从目标中删除“Main Interface”并在AppDelegate中进行硬编码,如下所示:
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
ViewController *yourController = (ViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"StartVC"];
self.window.rootViewController = yourController;
我有另一个错误,就是找不到故事板ID“StartVC”。
你也遇到这个问题了吗?
更新:
尝试创建新的故事板并将其放入主界面中,结果得到相同的错误。
*** 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''
更新3
在Xcode 6.4中一切正常!我认为这是Xcode 7的一个bug。