Re: Quick Question
Re: Quick Question
- Subject: Re: Quick Question
- From: Stéphane Sudre <email@hidden>
- Date: Fri, 3 Aug 2001 13:09:08 +0200
On vendredi, ao{t 3, 2001, at 09:23 PM, stuartbryson wrote:
How do you make your application automatically quit when the main
window is closed?
If it's a 1 Window application (1 Main Window and additional Utility
windows)
- (BOOL)windowShouldClose:(id)sender
{
[[NSApplication sharedApplication] terminate:self]; // Or [NSApp
terminate:self];
return YES;
}
with the controller being the delegate of the main window.
Then, you can handle some stuff with the applicationWillTerminate: method
I'm wondering if I didn't see an option for doing this without the code
but I was not able to find it by looking quickly at the documentation.