Question

I have the problem, that my PreferencePanel only shows up if I launch it from Xcode in release and debug mode. But if I start the archived .app of my application, nothing happens if I click my Preferences button. If launched from Xcode, if I open the pref panel, close it and wait a few seconds and try that command again also nothing happens, the panel doesn't show up. I'm using a NSWindowController class, called "PreferenceController" and load a nib file in the -(id)init method with return [super initWithWindowNibName:@"Preferences"];. The File Owner of the xib is set to "PreferenceController" and the window property is connected with the panel in the xib.

In my AppController I have an method -(IBAction)showPreferencePanel:(id)sender to open the panel.

@interface AppController : NSObject {
    PreferenceController *_preferenceController;
}

…

- (IBAction)showPreferencePanel:(id)sender
{
    if (!_preferenceController) {
        _preferenceController = [[PreferenceController alloc] init];
    }

    [_preferenceController showWindow:self];
}

The AppController is instantiated in the mainMenu.xib.

Thanks for your help.

Was it helpful?

Solution

I found out, what's the problem. I developed a NSStatusItem only app and the panel option HideOnDeactivate was set to ON. If I now open the Panel it looses automatically the focus and is gone. Thanks for helping.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top