I’m loading a Nib which contains a preference window using:
PreferenceWindowViewController *pref = [[PreferenceWindowViewController alloc] init];
[NSBundle loadNibNamed:@"PreferenceWindow" owner:pref];
But the problem is that the user could easily click on the “preferences option” in the menu bar (File -> Preferences) again without closing the current open preference window, i was thinking of a boolean variable to be set to true once the nib is opened, but was unsure how to re set the boolean variable to false (Nib not loaded) which exists in the main class when the close the window in the preference view controller class
Why don’t you just load the window once at app startup and then do:
every time the user clicks on your menu item. Wouldn’t that be easier?