Separate Nib For Sheets?
Separate Nib For Sheets?
- Subject: Separate Nib For Sheets?
- From: Zack Rothauser <email@hidden>
- Date: Fri, 9 Jan 2004 17:52:05 -0500
I have an application that shows a sheet from another window on top of
a window in the main nib file.
Whenever it is run I get the following error:
*** Assertion failure in -[NSApplication
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:
didEndSelector:contextInfo:], AppKit.subproj/NSApplication.m:2763
Modal session requires modal window
Here is the code from the application controller:
- (void)showOutputForCommand:(Command *)command
{
// OutputController is the sheet's window controller
OutputController *outputController = [[OutputController alloc] init];
[NSBundle loadNibNamed:@"Output" owner:outputController];
[outputController runCommand:command inWindow:runPanel];
}
And from OutputController:
- (void)runCommand:(Command *)command inWindow:(NSWindow *)aWindow
{
if (aWindow != nil) {
[NSApp runModalForWindow:outputPanel];
// outputPanel is connected to the sheet to be shown
[NSApp beginSheet:outputPanel
modalForWindow:aWindow
modalDelegate:nil
didEndSelector:nil
contextInfo:nil];
} else {
[outputPanel makeKeyAndOrderFront:self];
}
}
Thanks,
Zack Rothauser
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.