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

Re: Implementing Quit


  • Subject: Re: Implementing Quit
  • From: glenn andreas <email@hidden>
  • Date: Fri, 12 May 2006 14:04:00 -0500


On May 12, 2006, at 1:56 PM, Paolo Bertani wrote:

But this invokes the delegate again...

I have set up a flag to know if it is the second time the delegate is invoked
(first time: user select quit,
second time: the user don't want to save and the [NSApp terminate:self] is called)


But is seem quite tricky while everything else in Cococa is much more straightforward.
I feel I'm missing something about the single window application architecture...


Anyway,
	thank you!


Look at the delegate's appShouldTerminate - it can handle either terminating immediately (or not), such as in the case where the "data" is already saved, or it can return a value meaning "I need to ask the user something - I'll get back to you". With that case, you can present your sheet, and when they're done you can tell NSApp "yes, now you can finish quitting like you started before".

It basically handles exactly what you want...



Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Implementing Quit (From: Paolo Bertani <email@hidden>)
 >Re: Implementing Quit (From: Mike Abdullah <email@hidden>)
 >Re: Implementing Quit (From: Paolo Bertani <email@hidden>)

  • Prev by Date: Re: Implementing Quit
  • Next by Date: RE: Implementing Quit
  • Previous by thread: Re: Implementing Quit
  • Next by thread: RE: Implementing Quit
  • Index(es):
    • Date
    • Thread