Reputation: 283
If I close my app with the red x in the top left corner I can't reopen it. Why and how can I change this.
I want to open the windows after closing again and again.
Upvotes: 0
Views: 119
Reputation: 10198
If your window's behavior is checked "release When Closed" you need to uncheck it. Go to Attributes Inspector, here:
You didn't wrote how are you doing reopening window. So if You want to reopen window on dock icon click you can do it simply like this:
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
{
if (flag) {
return NO;
} else {
[windowOutlet orderFront:self];
return YES;
}
}
Upvotes: 5