The applicationDidFinishLaunching: method of the NSApplication delegate method will be called when the application finishes loading. Many project templates are set by the delegate. If you use, just add the appropriate method to it.
If your project does not have an installed application delegate, you will need to do it yourself. First, create a new class to work as your delegate (you can use it if there is something logically appropriate). Now make sure the class is created in your MainMenu.nib. Finally, set the delegate property of the File object to the instance instance in IB.
source share