添加一个继承自NSDocument的类:
添加继承NSDocument的类文件
2. : 这里要填写你继承自NSDocument的类名,要在你的类名前加上命名空间(ObJective-C不用$(PRODUCT_MODULE_NAME)<
在逆向过程中发现打开文档用的是NSDocument,-showTemplateChooser:模板选择器. 这意味着一个trace文件是通过NSDocument加上自定义文档类型(模板)来储存的, 当然这个文件类型并不会存在于MIME当中的. ?
• NSDocument(AppKit):在 macOS 开发中,NSDocument 常被子类化,其中 write(to:ofType:) 等方法需要自定义。 如果这些方法是抽象的,任何 NSDocument 的子类都必须提供自己的数据序列化逻辑。
Document应用程序是一般是通过 NSDocument 或其子类 NSPersistentDocument)从模型文件(后缀为 xcdatamodeld)读取。 1.3.4 NSPersistentDocument > Persistent Document -NSPersistentDocument NSPersistentDocument是 NSDocument The NSPersistentDocument class is a subclass of NSDocument that is designed to let you easily take advantage methods to access the document’s managed object context and provides implementations of the standard NSDocument