Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preferences Window Problem (Once Open And Closed, Will Not Open Again)

The problem I've got is that when the preferences window is opened and then closed, it will not open again. Why is this happening and how can this be fixed?

EDIT: Just noticed also I've got the same problem with Main Window.

The window is being opened via the menu bar and is in a separate NIB file.

like image 574
Joshua Avatar asked Dec 09 '22 21:12

Joshua


2 Answers

It sounds like you forgot to set the 'window' outlet of your window controller (in the Nib, the File's Owner) to point to your window. Once you connect its 'window' outlet the window controller's showWindow: method will work.

like image 129
Douglas Patriarche Avatar answered Jan 20 '23 06:01

Douglas Patriarche


Hard to say without seeing the code, but one possibility is that you have "Release When Closed" checked for the window in Interface Builder, and you are loading it once, caching it, then expecting to be able to close and re-open it without loading from the nib again.

like image 27
smorgan Avatar answered Jan 20 '23 05:01

smorgan