1st time I click on menu item I see the window. I then use close button. Click 
on the same menu item and get nothing. Action handler executes, but I see no 
window.

In app delegate:

@property (strong, nonatomic) NSWindowController *myWindowController;

- (IBAction)openSingleWindow:(id)sender {
    if (self.myWindowController == nil) {
        self.myWindowController = [[NSWindowController alloc] 
initWithWindowNibName:@"MyWindow"];
    }
    NSLog(@"window: %@", self.myWindowController.window); // displays nil at 
all times
    [self.myWindowController showWindow:self];
    NSLog(@"window: %@", self.myWindowController.window); // displays nil at 
all times
}

window is configured with options:
(unchecked) Release When Closed
Xib file owner is set to NSWindowController

What am I missing?

My goal is to display one window at a time (Preferences). Creating new 
controller and displaying it caused multiple windows.
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to