Re: NSWindow and how to message it
Re: NSWindow and how to message it
- Subject: Re: NSWindow and how to message it
- From: Andreas Monitzer <email@hidden>
- Date: Tue, 22 May 2001 22:52:05 +0200
On Tuesday, May 22, 2001, at 05:01 , John Pannell wrote:
I have encountered puzzling behavior in trying to send a message to a
window - I clearly am missing something very simple. Here's the details:
- (void)hideMyWindow:(id)sender
{
[myWindow orderOut];
}
Problems abound - while building, I am told "method not found", while
running, I get the error "-[NSWindow orderOut] : selector not recognized"
. So, clearly everything is hooked up OK in IB (since I get the
confirmation that the message is being sent to an NSWindow), but for some
reason NSWindow doesn't want to respond (even though the documentation
says this is a perfectly reasonable message to send to a window).
Well, my documentation says something different:
- (void)orderOut:(id)sender
Takes the receiver out of the screen list. If the receiver is the key or
main window, the NSWindow immediately behind it is made key or main in its
place. Calling the orderOut: method causes the receiver to be removed from
the screen, but does not cause it to be released. See the close method for
information on when a window is released.
So, the correct call is "[myWindow orderOut:nil];".
andy
--
Description forthcoming.