- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我刚刚创建了一个新的核心数据文档应用程序,并且在提供的模板中(只有 NSPersistentDocument 子类和模型),我想坚持
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
return YES;
}
某处...我该把它放在哪里?
最佳答案
默认情况下,Xcode 基于文档的应用程序模板不包含 AppDelegate 类。您必须手动创建它(通过子类化 NSObject),将其添加到 MainMenu.xib 并将连接从 Application 的“代理”导出拖到新的 AppDelegate 对象。
关于cocoa - NSPersistentDocument 应用程序委托(delegate),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7924637/
我的应用程序当前使用 CoreData 作为后端来存储到存储在 ~/Library/Application Support/MYAPP/MyDataFile.sqlite 中的单个 SQL 数据文件。
我想设置 NSPersistentDocument 对象窗口的一些属性。我如何访问它? 还有比这样更好的方法吗? [[[[self windowControllers] objectAtInd
ALM 很棒。但是我无法让它在使用带有 NSDocument 的 Core Data 的项目上工作。似乎默认情况下禁用了 ALM。 美好的。对于任何普通项目,您需要在此行的字典中添加两个适当的选项:
我有一个基于 NSPersistentDocument 的应用程序,它根据不同的条件和数据具有三个不同的 View ,并且每个 View 都工作正常。 现在客户还想从 shell 脚本运行应用程序。
我刚刚创建了一个新的核心数据文档应用程序,并且在提供的模板中(只有 NSPersistentDocument 子类和模型),我想坚持 - (BOOL)applicationShouldTerminat
我已经对 NSPersistentDocument 进行了子类化。我也重新命名了窗口。但是当我运行应用程序时,我得到应用程序窗口的标题为“无标题”。没有可用于更改标题的 -setTitle: 方法。我
我创建了一个使用实体模型构建器及其相关内容的 OSX 应用程序,为简单起见,请考虑只有两个 NSString 的实体。 该应用程序正在生产中并且工作正常,现在我需要向现有实体添加新属性(仅存在一个实体
似乎有关于在基于文档的应用程序中使用核心数据的信息。我有一个窗口 Controller ,在当前文档中运行模式窗口。用户将数据输入到文本字段中,该字段创建一个可变的字符串数组,我想用它来创建模型对象(
我正在考虑制作一个基于核心数据的以文档为中心的应用程序,但我希望保存的文件格式是我自己专有的 XML、图像和其他内容包。 我的计划是使用 NSPersistentDocument 的子类,当收到 -w
因为我使用的是自定义核心数据堆栈,所以我将覆盖 init、readFromURL、writeToURL 和 revertToContentsOfURL 函数。 当我单击“浏览所有版本”时,文件的先前版
我正在尝试使用我觉得相对舒服的 OCUnit/SenTest 框架编写集成测试。该测试是关于 NSPersistentDocument 子类的加载,该子类依赖于成功导入的 CoreData 托管对象模
我正在尝试对 Core Data 中的 SQLite 存储进行轻量级迁移。使用 Xcode 4.3.1 在 Lion 10.7.3 上工作。 在我的 NSPersistentDocument 子类 (
我的基于 Core Data 文档的应用程序在“另存为”时崩溃。该问题似乎与标题为“NSPersistentDocument objects "gutted" after Duplicate, Ren
我在保存 NSPersistentDocument 时遇到了奇怪的行为。我可以创建一个自动保存的新文档,没有问题。但是当我保存它时 write(to: ofType: for:absoluteOrig
使用 NSPersistentDocument 加载现有文档时,作为初始化的一部分,我想准备一些内容: NSFetchRequest *req = [NSFetchRequest fetchR
我正在尝试使用 Lion 中的新沙箱规则使 Mac 应用程序保持最新状态。但是,尽管请求了 com.apple.security.files.user-selected.read-write 权限,但
这里是核心数据新手。我正在尝试更改 NSPersistentDocument 的默认 NSManagedObjectContext,以便初始化它并将其与 NSMainQueueConcurrencyT
我在 NSPersistentDocument 窗口中有一个 NSTextView。我将文本字段的内容绑定(bind)到“二进制数据”核心数据字段,但是当我在 TextView 中键入文本时,文档的标
我想创建一个使用 swift 核心数据 以标准 macOS 方式工作的“文档”[自定义扩展名,包含与该文档相关的所有数据的单个"file"/文件包装器] 这似乎是不可能的。该文件非常清楚地说明 NSP
我使用 Xcode 9.2 创建了一个全新的 macOS 应用,并在项目模板中选择了“创建基于文档的应用程序”和“使用核心数据”。 我做了四项更改: 编辑 CoreData 模型以添加一个名为“Ent
我是一名优秀的程序员,十分优秀!