Windows close button quites App?

So what you need to do first is have the window you want to close be connected to an IBOutlet in the nib. For this example i connected the window to an outlet named “mainWindow”.

The code to add is:
Code:

- (void)awakeFromNib {
        [mainWindow setDelegate:self];
}

- (void)windowWillClose:(NSNotification *)aNotification {
	[NSApp terminate:self];
}


from : http://forums.macrumors.com/showthread.php?t=105229

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.