Re: WindowController

Gerriet M. Denkmann

On 18 Jul 2017, at 04:18, Quincey Morris <> wrote:

On Jul 17, 2017, at 14:08 , Gerriet M. Denkmann <> wrote:

It never has. Even after the first time where showWindow will succeed.
This is — in some sense — impossible. There is a window. (You can see it.) Either the debugger is lying to you, or the window is unrelated to the window controller. Whichever it is, it’s worth investigating further.
if ( self.prefController == nil )
self.prefController = [ [ NSWindowController alloc ] initWithWindowNibName: @"PrefWindow" ];
NSLog(@"%s prefController %@",__FUNCTION__, self.prefController);

[ self.prefController showWindow: self ];
NSLog(@“%s window %@“,__FUNCTION__, self.prefController.window);

prints prefController once
window = nil always

BTW, in your XIB file for the preferences window, did you leave “Visible at launch” checked? It shouldn’t be, if you’re using a window controller, but OTOH I can’t see it having this result if you did.
Without “Visible At Launch” I never see a window - not even the first time.

Kind regards,


Join to automatically receive all group messages.