【发布时间】:2020-02-11 02:03:21
【问题描述】:
我正在尝试从我的 OS X 应用程序的情节提要中实例化 NSWindowController:
NSWindowController *mainWindowController = [[NSStoryboard storyboardWithName:@"Main" bundle:nil] instantiateControllerWithIdentifier:@"MainWindow"];
但这就是我得到的:
Storyboard (<NSStoryboard: 0x618000008500>) doesn't contain a controller with identifier 'MainWindow'.
但在故事板中:
设置好了。不,没有其他故事板。是的,我已经尝试清理项目和构建文件夹,但没有任何变化。
为什么会出现这个错误?
更新:我正在构建我的应用程序,回到情节提要,我看到情节提要 ID 未设置:
Storyboard ID 如何自行取消设置?
【问题讨论】:
标签: objective-c macos storyboard nsstoryboard