Mac OS Xプログラムがステータスバーにのみ表示され、設定ウィンドウを表示する必要があります。私はこのIBActionを持っています:
- (IBAction)showPreferences:(id)sender {
[self.preferencesWindowController showWindow:self];
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
}
applicationDidFinish Lauchingには、次のものがあります。
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Load the app's preferences window (but does not display it)
self.preferencesWindowController = [[PreferencesWindowController alloc] initWithWindowNibName:@"PreferencesWindowController"];
[...]
}
クラスヘッダー:
#import <Cocoa/Cocoa.h>
#import "AppPref.h"
@interface PreferencesWindowController : NSWindowController {
}
@end
問題は、設定ウィンドウが1回だけ表示されることです。私がそれを閉じるとき、それはもう二度と現れません。
何が問題なのですか?