NSApplication
- (void)beginSheet:(NSWindow *)sheet modalForWindow:(NSWindow *)docWindow modalDelegate:(id)modalDelegate didEndSelector:(SEL)didEndSelector contextInfo:(void *)contextInfo;
例
- (IBAction)beginSheet:(id)sender
{
[NSApp beginSheet:sheet
modalForWindow:window
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
}
- (IBAction)sheetOK:(id)sender
{
[[NSApp endSheet:sheet returnCode:0];
}
- (void)sheetDidEnd:(NSWindow *)sheet
returnCode:(int)returnCode
contextInfo:(void *)contextInfo
{
[sheet orderOut:self];
}