How do you make the Application window open when the dock icon is clicked?

后端 未结 6 2062
余生分开走
余生分开走 2020-12-07 22:50

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

6条回答
  •  孤街浪徒
    2020-12-07 23:22

    Implement - (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag in 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.

提交回复
热议问题