gpt4 book ai didi

cocoa - NSPersistentDocument 应用程序委托(delegate)

转载 作者:行者123 更新时间:2023-12-03 17:32:18 24 4
gpt4 key购买 nike

我刚刚创建了一个新的核心数据文档应用程序,并且在提供的模板中(只有 NSPersistentDocument 子类和模型),我想坚持

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
return YES;
}

某处...我该把它放在哪里?

最佳答案

默认情况下,Xcode 基于文档的应用程序模板不包含 AppDelegate 类。您必须手动创建它(通过子类化 NSObject),将其添加到 MainMenu.xib 并将连接从 Application 的“代理”导出拖到新的 AppDelegate 对象。

关于cocoa - NSPersistentDocument 应用程序委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7924637/

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