I’m surprised this doesn’t happen automatically, but I would like my applications window to open automatically when the Dock icon is clicked.
Just to clarify, when i open the app, the window automatically opens, but when I click the cross for the window but leave the App running, the window won’t open when i click the dock icon.
Implement
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flagin your app delegate. Check the documentation for the details of the return value.Document based apps and non-document based apps behave slightly differently. If there are no open windows when the dock icon of a document based app is clicked then it will create a new document. If there are no open windows when the dock icon of a non-document based app is clicked then it will do nothing.