Is the 'window' outlet of the XIB file's owner set to point to the window in the XIB? It doesn't sound like it.
toggle quoted messageShow quoted text
On Jul 17, 2017, at 3:44 PM, Gerriet M. Denkmann <email@example.com> wrote:
On 18 Jul 2017, at 04:18, Quincey Morris <firstname.lastname@example.org> wrote: if ( self.prefController == nil )
On Jul 17, 2017, at 14:08 , Gerriet M. Denkmann <email@example.com> wrote:
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.
It never has. Even after the first time where showWindow will succeed.
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.