我有一个带有首选项窗口的 Mac 应用程序。首选项窗口以模态方式打开
-(IBAction)displayPreferencesWindow:(id)sender{
if (!pc) {
pc = [[PreferencesController alloc] initWithWindowNibName:@"PreferencesController"];
pc.delegate = self;
}
NSWindow *pcWindow = [pc window];
[NSApp runModalForWindow: pcWindow];
[NSApp endSheet: pcWindow];
[pcWindow orderOut: self];
}
在首选项窗口中,我有一个打开帐户首选项面板的按钮
- (IBAction)openSystemPrefs:(id)sender {
[[NSWorkspace sharedWorkspace] openFile:@"/System/Library/PreferencePanes/Accounts.prefPane"];
}
问题是帐户首选项面板没有在实际窗口前面打开。我怎样才能做到这一点?