gpt4 book ai didi

swift - 在 APPNAME UITests-Runner.app 的捆绑 NSBundle 中找不到名为 'Main' 的 Storyboard

转载 作者:行者123 更新时间:2023-11-28 06:16:56 24 4
gpt4 key购买 nike

当我尝试从 XCTestCase 类中的 Storyboard实例化 View Controller 时,应用程序崩溃了。

最佳答案

而不是使用Bundle.main 同时实例化您的包使用

let bundle = Bundle(for: type(of: self))
let storyBoard = UIStoryboard(name: "Main", bundle: bundle)

关于swift - 在 APPNAME UITests-Runner.app 的捆绑 NSBundle 中找不到名为 'Main' 的 Storyboard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44846167/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com