我正在使用 SDK 10.8。
我正在子类NSPersistentDocument
化(但这个问题可能会让人们对子类化感兴趣NSDocument
)并且我想停用窗口恢复。到目前为止,这是我所做的:
-(void)restoreStateWithCoder:(NSCoder *)coder
{
NSLog(@"No 1") ;
}
-(void)restoreDocumentWindowWithIdentifier:(NSString *)identifier
state:(NSCoder *)state
completionHandler:(void (^)(NSWindow *, NSError *))completionHandler
{
NSLog(@"No 2") ;
}
问题是当我尝试在我的应用程序中创建一个新文档时,没有显示任何窗口。
停用窗户恢复的正确方法是什么?