Can't get same window to show twice
Can't get same window to show twice
- Subject: Can't get same window to show twice
- From: -Sergei G- <email@hidden>
- Date: Fri, 02 Mar 2012 02:34:36 -0800
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@hidden)
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:
This email sent to email@hidden