繁体   English   中英

Xcode 7无法找到名为的故事板

[英]Xcode 7 Could not find a storyboard named

将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

我尝试从目标“主界面”中删除并在AppDelegate中像这样硬编码

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
ViewController *yourController = (ViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"StartVC"];
self.window.rootViewController = yourController;

我有另一个错误,如找不到故事板ID StartVC

你也有这个问题吗?

UPD:

尝试创建新的故事板并放入主界面并获得相同的错误

*** 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

在Xcode 6.4中一切正常! 我认为这是Xcode 7中的错误

使用故事板引用在Xcode 7中遇到此问题。 可能是一个解决方案:

  • 修复文件检查器中每个故事板的本地化相同(基础,英语...)。 这可能是捆绑的一个问题。

有时会发生这种情况,因为未选中故事板中文件检查器中的目标成员身份。 确保已检查该值。

这突然开始发生在我身上,看起来像Xcode 7中的一个错误。我通过编译到iPhone 6模拟器而不是6s来修复它(可能只是暂时)。 我们将看看这是否是永久修复。

要恢复,我必须清理构建文件夹并重新启动(退出)Xcode。 这解决了6s的问题,为一些编译。

作为一个额外的潜在答案,我的问题是应用程序中的“base.lproj”文件夹名称的小写首字母,但Xcode期望大写的第一个字母“Base.lproj”。

显然在某些方面发生了变化(我可以看到我的git变化中的套管变化)

我不得不编辑project.pbxproj文件,用“Base”替换每个“base”的出现

如果您使用[NSBundle mainBundle]只需将其更改为nil即可 在其他帖子中查看我的答案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM