Re: WindowController

Gerriet M. Denkmann

On 18 Jul 2017, at 00:30, Quincey Morris <quinceymorris@...> wrote:

On Jul 17, 2017, at 07:12 , Gerriet M. Denkmann <g@...> wrote:

it works exactly once
You haven’t really done “due diligence” with this problem description. What does “works” mean?
“Works” means that showWindow does indeed show a window.

That the window doesn’t reappear after it’s made to disappear?
Yes. After the red button got clicked on the PrefWindow, it never will appear again.

When you call that action method again, is self.prefController nil or not?
The first time prefController is of course nil.
The next time it is not.

Is there a corresponding line of code that sets self.prefController to nil when the window is closed?

Or does the “showWindow” not make the window visible?
Exactly: this is the problem.

Does the action method get called at all, after the first time?
It gets called.

What kind of object is “self”?
App delegate.

How is the “prefController” property declared?

How did you hide the window (orderOut: or close)?
Clicking the red button.

Is it a NSWindow or a NSPanel?
Same problem for both.

Have you made sure the “release on close” checkbox isn’t set in IB?
It is not checked.

(But do you really want the prefs controller to hang around when it’s closed? Seems like a waste of memory to me.)
Yes. But loading the window again would be a waste of Cpu time.
Not sure what is worse.

Kind regards,


Join { to automatically receive all group messages.