• 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: Quick Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >Quick Question (From: stuartbryson <email@hidden>)

  • Prev by Date: Re: [HELP] beginCriticalAlertSheet NSSelector implementation in Cocoa (Java/ObjC)?
  • Next by Date: re: [HELP] beginCriticalAlertSheet NSSelector implementation
  • Previous by thread: Re: Quick Question
  • Next by thread: Re: Quick Question
  • Index(es):
    • Date
    • Thread