单击按钮时,我正在使用以下代码
testViewController *myWindowController = [[testViewController alloc] initWithWindowNibName:@"RecordingsViewController"];
[myWindowController setDelegate:self];
activeModalWindow = [myWindowController window];
[NSApp beginSheet:[myWindowController window]
modalForWindow:[self window]
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
contextInfo:nil];
[NSApp runModalForWindow:[myWindowController window]];
[[myWindowController window] orderOut: self];
在这个 testViewController 中,我正在使用代码显示警报
NSString *theAlertMessage = [NSString stringWithFormat: @"Already added"];
NSRunAlertPanel(@"", theAlertMessage, @"OK", nil, nil);
但是在单击此警报的确定按钮时。我的警报仍然在屏幕上。请帮忙!