相关疑难解决方法(0)

故事板不包含标识符为"MainWindow"的控制器

我试图NSWindowController在我的OS X应用程序中实例化一个故事板:

NSWindowController *mainWindowController = [[NSStoryboard storyboardWithName:@"Main" bundle:nil] instantiateControllerWithIdentifier:@"MainWindow"];

但这就是我得到的:

Storyboard (<NSStoryboard: 0x618000008500>) doesn't contain a controller with identifier 'MainWindow'.

但在故事板中:

在此输入图像描述

它已经确定.不,没有其他故事板.是的,我已经尝试清理项目和构建文件夹,但没有任何变化.

为什么我会收到此错误?

更新:我正在构建我的应用程序,回到故事板,我发现故事板ID未设置:

在此输入图像描述

故事板ID如何自行解除?

macos objective-c storyboard nsstoryboard

7
推荐指数
1
解决办法
1086
查看次数

标签 统计

macos ×1

nsstoryboard ×1

objective-c ×1

storyboard ×1