ios - Storyboard 不包含仅在 TestFlight 上带有标识符的 View Controller

标签 ios swift xcode swift3 testflight

我为 iOS 应用程序使用 XLPagerTabStrip 库。 我重写了这个库中的函数以创建 Controller :

override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {

    var controllers:[UIViewController] = []

    let storyboard = UIStoryboard(name: "MediaStoryboard", bundle: nil)
    let controller = storyboard.instantiateViewController(withIdentifier: "VideosListController") as! VideosListController
    controllers.append(controller)

    let controllerNews = storyboard.instantiateViewController(withIdentifier: "NewsListController") as! NewsListController
    controllers.append(controllerNews)

    return controllers
}

我的 MediaStoryboard.storyboard(NewsController): Link to image

当我通过 Xcode 运行它时,一切都很好。但是当我将其上传到 iTunes Connect 并通过 TestFlight 运行它时,我在日志中收到此错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard (<UIStoryboard: 0x1c447f4c0>) doesn't contain a view controller with identifier 'NewsListController'' 
*** First throw call stack:
(0x181b82d8c 0x180d3c5ec 0x18c0d1ea8 0x1004da07c 0x101561dfc 
0x1015626fc 0x101562a48 0x101552064 0x101553238 0x1004d9b40 0x1004d9e6c 
0x18b75eee0 0x18b75eacc 0x18ba9c3b4 0x18b80bac8 0x18b80b720 0x18b7ff424 
0x18b757770 0x185cf925c 0x185cfd3ec 0x185c69aa0 0x185c915d0 0x18bb3054c 
0x18c10d4c0 0x18c106258 0x181b2b404 0x181b2ac2c 0x181b2879c 0x181a48da8 
0x183a2b020 0x18ba2978c 0x10044ce64 0x1814d9fc0)

为什么,你?

最佳答案

您现在可能已经找到了答案,我怀疑有多种方法可以找到答案。但是对于来这里解决这个令人沮丧的问题的其他读者来说,这对我有用:

  1. 打开您的 Storyboard并点击有问题的场景。如果你检查身份检查器,你可能会看到这样的东西: module-not-entered-correctly

  2. 在模块字段内单击并明确选择模块,即使它似乎已被正确选择。它现在看起来像这样: module-entered-explicitly

  3. 清理、构建并运行。

关于ios - Storyboard 不包含仅在 TestFlight 上带有标识符的 View Controller ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49908143/

相关文章:

ios - 我应该怎么办?在 SpriteKit swift 中它说 : Type 'GameScene' does not conform to protocol 'GKGameCenterControllerDelegate' ?

android - 应用程序语言更改后的Firebase远程配置即时本地化

iphone - 如何设置字体大小以填充 UILabel 高度?

ios - 从 'requestImageForAsset' 返回的 UIImage 大小甚至不接近 'targetSize' 设置

Swift 替换字符串中的整行

swift - 如何修复我的应用程序中使用 AVSpeechSynthesizer 播放播放列表的这个相当复杂的错误?

c++ - 在 Xcode 8 中加载 Fisher 人脸识别器时出现 OpenCV 错误

xcode - 如何设置 NSSegmentedControl 的外观以匹配 Xcode 的外观?

objective-c - 类别对内存使用有什么影响?

iphone - self.tableView insertRowsAtIndexPaths 来自 tableView 委托(delegate)