On Jul 17, 2017, at 07:12 , Gerriet M. Denkmann <g@...> wrote:
You haven’t really done “due diligence” with this problem description. What does “works” mean? That the window doesn’t reappear after it’s made to disappear?
When you call that action method again, is self.prefController nil or not? Or does the “showWindow” not make the window visible? Does the action method get called at all, after the first time? What kind of object is “self”? How is the “prefController” property declared? How did you hide the window (orderOut: or close)? Is it a NSWindow or a NSPanel?
A window controller has an owning reference to its window, so it should be impossible for the window object to disappear while the controller still exists, even if the window is closed. However, the semantics of the NSWindow “close” method are unclear, and it may be that you can’t show the window again afterwards, without creating a new window (or using orderOut: instead).