我正在尝试从OS X应用程序中的情节提要中实例化NSWindowController
:
NSWindowController *mainWindowController = [[NSStoryboard storyboardWithName:@"Main" bundle:nil] instantiateControllerWithIdentifier:@"MainWindow"];
但是这就是我得到的:
Storyboard (<NSStoryboard: 0x618000008500>) doesn't contain a controller with identifier 'MainWindow'
。
但是在情节提要中:
已设置。不,没有其他情节提要。是的,我尝试清理项目和构建文件夹,但没有任何变化。
为什么会出现此错误?
更新:我正在构建我的应用程序,回到情节提要,但我看到未设置情节提要ID:
情节提要ID本身如何无法设置?
这绝对是Xcode的错误。重新启动Xcode解决了该问题。
在11.3中确认。这是一个浪费时间的东西,再加上一个: