WindowController


Gerriet M. Denkmann
 

This works:

- (void)showPreferences: (NSMenuItem *)sender;
{
(void)sender;

// if ( self.prefController == nil ) // this line should not be commented out
{
self.prefController = [ [ NSWindowController alloc ] initWithWindowNibName: @"PrefWindow" ];
};

[ self.prefController showWindow: self ];
}

But when I *not* comment out the if… line it works exactly once.

How can I convince my NSWindowController to keep its window?

Gerriet.

Join cocoa@apple-dev.groups.io to automatically receive all group messages.