I want to programmatically re-open the main window of my Cocoa application after the user closed it with the X button.
I know it’s still somewhere in memory but I don’t know where.
I want to programmatically re-open the main window of my Cocoa application after the
Share
If you’re using the default Cocoa Application template, your app delegate has a reference to the window that’s in MainMenu.xib. You can simply call
perhaps in an
IBActiontriggered by a menu item, to reopen the window. Note: be sure that the “Release when closed” and “One shot” boxes are unchecked in IB.