windowDidBecomeMain when app being made active
windowDidBecomeMain when app being made active
- Subject: windowDidBecomeMain when app being made active
- From: James Mastro <email@hidden>
- Date: Tue, 27 Jan 2004 13:54:49 -0500
I have the following code in a window delegate:
- (void) windowDidBecomeMain:(NSNotification *) notification
{
NSWindow *window = [NSApp mainWindow];
DEBUG_ASSERT( window != nil );
}
This code works fine if I switch among windows in my application.
However, if I switch to a different app, then switch back, the
assertion fires because [NSApp mainWindow] is returning nil. Why is
this? If the window "did" become main, shouldn't I get back my window?
This happens no matter how I switch back into my app. Clicking a
window, the dock icon, etc. Any ideas?
-jim
_______________________________________________
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.