Justin Meiners
Justin Meiners

Reputation: 11113

NSWindowController showWindow only works once

I have a subclass of NSWindowController that has its own nib and another class that has an IBAction to show the window and loads it like so.

if (!propertiesController){
    propertiesController = [[PropertiesController alloc] init];
}
[propertiesController showWindow:self];

It the first time but after I close the window and call this method again the window is not displayed. I am sure the window is not getting released. Do I possibly have to override showWindow to order the window to the front? Or do I have to specify what window the controller uses in the nib?

Upvotes: 1

Views: 1144

Answers (1)

G3z
G3z

Reputation: 656

have you tried

[propertiesController.window makeKeyAndOrderFront:self];

?

Upvotes: 1

Related Questions