私は次のクラスを持っています:
@interface SpWindow : NSWindow <NSCoding> {
BOOL _editMode;
SpBgView *bgView;
} ...
...それから私はアーカイブを呼び出します。私のエンコード方法は次のとおりです。
- (void) encodeWithCoder:(NSCoder *)aCoder {
NSLog(@"encodeWithCoder CALLED FOR SpWindow");
[super encodeWithCoder:aCoder];
NSLog(@"SpWindow's encodeWithCoder got past the super call");
[aCoder encodeObject:bgView forKey:@"bgView"];
[aCoder encodeBool:_editMode forKey:@"_editMode"];
}
...ただし、この[super encodeWithCoder:aCoder];
ビットの結果、コンソールログに次のようになります。
encodeWithCoder CALLED FOR SpWindow
<SpWindow: 0x20009f660> does not support archiving
*** -[NSKeyedArchiver finalize]: warning: NSKeyedArchiver finalized without having had -finishEncoding called on it.
... NSWindowのドキュメントによると、クラスはNSCodingプロトコルに準拠しているため、この問題が発生する理由がわかりません。
何か案は ?
---編集: NSWindowのクラスリファレンスは次のことを示しています。
Conforms to NSCoding (NSResponder)
...だけではありません"Conforms to NSCoding"
-これは、NSResponderビットのみがNSCodingに準拠していることを意味していると思いますか?