Re: makeKeyAndOrderFront not working
Re: makeKeyAndOrderFront not working
- Subject: Re: makeKeyAndOrderFront not working
- From: Daniel Jalkut <email@hidden>
- Date: Fri, 09 Dec 2005 00:41:04 -0500
Hi Daniel. You can narrow your question down quite a bit. You've
implicitly asked several questions - some of which you can easily
answer yourself.
1. Does awakeFromNib get called? Answer by adding an NSLog statement
or set a breakpoint.
2. Is centerWindow connected correctly? Answer by examining the
variable after breaking in awakeFromNib.
\3. Does the nib that contains your controller even get instantiated
at runtime? One easy way to answer this is to add a window that has
"visible at launch time" set.
These questions are all more pressing than wondering whether or not
"makeKeyAndOrderFront" works or not. Of course it won't work if it
never gets called or gets sent to a nil object.
Daniel
On Dec 9, 2005, at 12:25 AM, Daniel Child wrote:
I am having trouble getting a window to become the frontmost window
on startup.
In appController.h I declare a window.
IBOutlet NSWindow *centerWindow;
I connect the controller "cube" instance to the window to be
opened, connecting the "centerWindow" outlet that is available
after reading files. But when the application starts up, the window
does not appear in front of previously opened apps. (This is a menu-
free app, by the way, but I don't think that should matter.)
I thought that if you instantiate the controller within Interface
Builder, then it will be "ready to use" when the application
awakens the nib. My code is quite basic:
- (void)awakeFromNib
{
[centerWindow makeKeyAndOrderFront:nil];
}
@end
....to no avail. I'm missing something terribly basic but still
can't find it. I thought that maybe I have to explicitly call
awakeFromNib, but then read it is called automatically. What's
missing?
_______________________________________________
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