我正在尝试将NSPanel显示为工作表.我天真地做着这样的事情:
SheetController *sheetController = [[[SheetController alloc]
initWithWindowNibName:@"Sheet"] autorelease];
[[NSApplication sharedApplication] beginSheet:sheetController.window
modalForWindow:self.window
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
Run Code Online (Sandbox Code Playgroud)
出于某些原因,我无法解决这个问题.当调用此部分代码时,工作表会暂时闪烁(因为autorelease消息).纸张永远不会挂在窗户上.
如果有人能指出我可以找到更多信息的地方,那将非常感激.