How to re-show main window after closed in Cocoa?

前端 未结 2 1441
情深已故
情深已故 2021-02-04 18:09

I want to re-show the main window after closed when click my app icon on dock. Anyone know how to do it ? Thanks in advance.

2条回答
  •  失恋的感觉
    2021-02-04 19:06

    Implement applicationShouldHandleReopen:hasVisibleWindows: in your application delegate. In your implementation, order the window back in. (Make sure you don't release it and it doesn't release itself when it gets closed.)

    See the documentation.

提交回复
热议问题