Reopen main window from Dock Icon
If you close a window in a Cocoa app there are several ways to bring the window up again and that depends on the developer. Anyway, the most common is to click on the Dock icon.
In order to do that the method is the following:
- (BOOL)applicationShouldHandleReopen:(NSApplication*)theApplication hasVisibleWindows:(BOOL)flag{ [mainWindow orderFront:nil]; return TRUE; }
Of-course this method is called in the Application delegate class.