我很难理解出了什么问题。我有一个带有 NSWindow 和 NSTextView 的 NSWindowController。我想将该 NSWindowController和NSWindow (连同它的所有控件)归档到一个文件中。
然后,我想取消归档相同的 NSWindowController 和 NSWindow 以及文件中的所有视图。但苹果文档说:
Note: Although the NSWindow class inherits the NSCoding protocol from NSResponder, the class does not support coding. Legacy support for archivers exists but its use is deprecated and may not work. Any attempt to archive or unarchive an NSWindow object using a keyed coding object raises an NSInvalidArgumentException exception.
重要的是,如果我 encodeWithObject:windowController,这不会存储 NSWindow。因此,当我为 windowController 进行 decodeWithObject 时,不会加载 NSWindow。
如何归档/取消归档 NSWindowController / NSWindow 及其所有控件?我错过了什么?