• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quit application when window closes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Quit application when window closes (From: "Kevin Dixon" <email@hidden>)
 >Re: Quit application when window closes (From: "Felipe Monteiro de Carvalho" <email@hidden>)

  • Prev by Date: Re: Help with Bindings
  • Next by Date: Re: best time to alter GUIs
  • Previous by thread: Re: Quit application when window closes
  • Next by thread: Pragmatic use of private framework class (in this case OSADictionary)
  • Index(es):
    • Date
    • Thread