Re: WindowController fails when trying add a panel [Name Warning]
Re: WindowController fails when trying add a panel [Name Warning]
- Subject: Re: WindowController fails when trying add a panel [Name Warning]
- From: John Nairn <email@hidden>
- Date: Tue, 28 Jun 2005 11:56:44 +0200
I added a panel to a nib file for a WindowController and now the
window fails to open. The code to open the window in the NSDocument
file is:
ctl=[[MovieController alloc] initForMPM:type];
[self addWindowController:ctl];
[[ctl window] makeKeyAndOrderFront:nil];
[ctl release];
and the window fails in the third line with error message
2005-06-28 11:06:30.041 NairnFEAMPM[11528] *** Assertion failure in
-[NSApplication
_commonBeginModalSessionForWindow:relativeToWindow:modalDelegate:didEn
dSelector:contextInfo:], AppKit.subproj/NSApplication.m:3037
2005-06-28 11:06:30.042 NairnFEAMPM[11528] Modal session requires
modal window
But this window is a non-modal window? The new panel is connected
to the window controller with
IBOutlet NSPanel *userLimitsPanel;
If I disconnect this link in the nib file the window opens fine
(but of course I can not use the panel). Reconnecting the link at
it fails again. As far as I can tell, I did this panel by identical
methods I have used before. All others work but this one fails?
The problem is solved and was the name of the action event to open
the new panel. I named the action event "setUserLimitsPanel" because
it opened a panel to set the user limits. This action event, however,
was called when the window was created I guess to initialize the
userLimitsPanel connection. I have not noticed this in documentation
before, but it seems like there are problems if a method looks like a
"set" accessor for a nib item even if you have no such accessors in
your own code. Or maybe one could use this "feature" to do something?
---------------
John Nairn (1-801-581-3413, FAX:1-801-581-4816)
Web Page: http://www.mse.utah.edu/~nairn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden