我得到了一个对话框而不是工作表。当应用程序不基于文档时它可以工作。现在它不起作用。
- (IBAction) showSheet:(NSWindow*)window
{
// User has asked to see the dialog. Display it.
NSLog(@"%@", self.contragentsSheet);
if (!_contragentsSheet)
[NSBundle loadNibNamed: @"contragentsSheet" owner: self];
[NSApp beginSheet:self.contragentsSheet
modalForWindow: [[NSApp delegate]window]
//modalForWindow: window
modalDelegate: self
didEndSelector: NULL
contextInfo: NULL];
//[contragentSearch becomeFirstResponder];
//NSLog ( @"Sheet is launched");
NSLog(@"%@", [[NSApp delegate]window]);
}