I have a NSWindow that I am launching makeKeyAndOrderFront
to the window from a MenuBarItem in an .xib file - it works, great.
However, I want to run a method when this window opens, so I subclassed NSWindow and set the window to the subclass.
When I do the shortcut, the window opens but is not the main window, when doing -(void)makeKeyWindow
When I do -(void)makeMainWindow
, the NSLog does nothing.
And, when I override makeKeyAndOrderFront
, it doesn't show at all (as expected).
Any help appreciated! Thanks!
windowDidLoad
– stevesliva-makeKeyAndOrderFront:
with a colon, not just-makeKeyAndOrderFront
. That's an important distinction. You may have failed to override the existing method and just created a new method that nobody ever calls. By the way, since you're calling-makeKeyAndOrderFront:
to show the window, why do you need to be called to know when it's shown? The code which calls-makeKeyAndOrderFront:
already knows. – Ken Thomasessuper
. – Ken Thomases