There is not much information in the question, but let me assume that the application is a single-window application (i.e. not NSDocument ).
A typical situation in this scenario is that the user closes the window and the application continues to work with the icon in the Dock, as expected.
In this situation, the user usually needs the window to appear again when the application is activated by clicking the icon in the dock.
To get this, you can implement applicationShouldHandleReopen:hasVisibleWindows: as follows:
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)visibleWindows { if ( visibleWindows ) { [self.window orderFront:self]; } else { [self.window makeKeyAndOrderFront:self]; } return YES; }
source share