gpt4 book ai didi

ios - 找不到 Storyboard

转载 作者:行者123 更新时间:2023-11-29 03:42:52 25 4
gpt4 key购买 nike

我有一个使用 nib 文件的项目,没有 Storyboard。根据应用程序设置,我需要显示与应用程序启动时现在显示的屏幕不同的屏幕。我在 Interface Builder 中创建了这个 View 作为 Storyboard。在主视图 Controller 的 viewWillAppear 方法中,当某些条件成立时,我尝试加载新的 Storyboard和 View Controller :

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"IncompleteSettings.storyboard" bundle: [NSBundle bundleWithIdentifier:@"Convention"]];
IncompleteSetingsViewController *vc = [storyboard instantiateInitialViewController];

我尝试将 nil 和 [NSBundle mainBundle] 传递给包参数。

我收到这个错误:

08-09 11:38:39.188 Convention[17091:11603] *** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“在 bundle NSBundle 中找不到名为“IncompleteSettings.storyboard”的 Storyboard(已加载) '

项目详情:

enter image description here

enter image description here

enter image description here

最佳答案

您不应在 Storyboard 的名称中添加扩展名:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"IncompleteSettings" bundle:nil];

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

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