ios - Xcode 7 找不到名为的 Storyboard

标签 ios objective-c iphone storyboard xcode7

将 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;

我还有另一个错误,比如找不到 Storyboard ID StartVC

你也有这样的问题吗?

更新:

尝试创建新的 Storyboard并放入主界面并得到相同的错误

*** 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 中的错误

最佳答案

使用 Storyboard引用在 Xcode 7 中遇到了这个问题。 可能是一个解决方案:

  • 修复文件检查器中每个 Storyboard的本地化(基础、英语...)。这可能是 bundle 的问题。

关于ios - Xcode 7 找不到名为的 Storyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32634866/

相关文章:

ios - 重用dispatch_get_main_queue()/dispatch_get_global_queue()的结果是否安全?

iOS 文件模式 : The `source_files` pattern did not match any file

iphone - 在一定数量的启动后出现警报

ios - 以编程方式创建多个标签变量

ios - 如何在 Swift 3 中显示文件共享中的文件

iphone - IOS 保存来自 UIImagePickerController 选择图像的 gif 图像

ios - 带有 SpriteKit 的 UITableView

iphone - 获得开发者证书的流程

iphone - 如何创建一个完整的 NSDate 对象来表示下一个指定的日期时间?

iphone - AFNetworking 缺少哪些主要的 ASIHTTPRequest 功能?