Re: Quit application when window closes
Re: Quit application when window closes
- Subject: Re: Quit application when window closes
- From: Joachim Deelen <email@hidden>
- Date: Wed, 12 Mar 2008 16:40:37 +0100
You could use:
- (void)windowWillClose:(NSNotification*)notification
{
[aboutWindow setDelegate:nil];
[NSApp terminate:self];
}
Replace "aboutWindow", with your window.
You could also use [NSApp stop:self] but terminate ends more
gracefully...
Am 12.03.2008 um 00:51 schrieb Felipe Monteiro de Carvalho:
Thanks for the answers, this indeed works very well. Delegates are
quite easy to work with!
But what if I wanted to have a "main window". i.e. the application
only closes when this window is closed? I did a small search, and I
see I can set a delegate for windowWillClose, but I wonder if this is
the best way to do this ...
thanks a lot =)
--
Felipe Monteiro de Carvalho
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Joachim Deelen
AQUARIUS-software
http://www.aquarius-software.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden