• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Separate Nib For Sheets?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: a good book
  • Next by Date: Re: a good book
  • Previous by thread: Re: a good book
  • Next by thread: NSWindowController problem
  • Index(es):
    • Date
    • Thread