다음 클래스가 있습니다 :내 NSWindow 서브 클래스에서 "아카이브를 지원하지 않습니다"라는 이유는 무엇입니까?
@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)
... NOT 그냥 "Conforms to NSCoding"
- 그래서 이것은 NSResponder 비트가 NSCoding을 준수한다는 것을 의미합니까?
나는 둘 다 가지고있다 : - (id) initWithCoder : (NSCoder *) aDecoder; - (void) encodeWithCoder : (NSCoder *) aCoder; ... 내 encodeWithCoder가 NSLog 문을 통해 호출되고 있음을 알았으므로이 문제는 아님 (이 문제를 생각해 주셔서 감사합니다. :-)) –