I am working on a new Mac App and I want to open the settings window, I have 2 Nib (xib) files, one for the main window and one for the settings window, after which I have openPreferences Action that shows the settings window, p. For example:
- (IBAction)openPreferences:(id)sender
{
PrefCont *cont = [[PrefCont alloc] init];
[cont showWindow:self];
}
this code works, but when I click more and then once on the Settings menu item that opens, the Settings window opens twice or more than two times.
Is there any way to do this with sth. e.g. makeKeyAndOrderFront, but should it be called by PrefController?
Or can I ask the Mac if the window opens? if not, show it or sth. link.
That would be very helpful, thanks to everyone!