• 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: Save changes prompt in non-document app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Save changes prompt in non-document app


  • Subject: Re: Save changes prompt in non-document app
  • From: Michael Ash <email@hidden>
  • Date: Thu, 29 Jan 2009 21:43:12 -0500

On Thu, Jan 29, 2009 at 10:20 AM, Andy Bettis <email@hidden> wrote:
> Hi,
>
> This should be simple enough - I have a non-document application with a
> simple one-window interface. I'd like to pop up a 'save changes, discard,
> cancel' sheet when Quit is chosen or the window is closed, the same way that
> a document based app would. But I can't quite work out where to put it and
> how to do it. I guess I should check in windowShouldClose: and
> applicationShouldTerminate: but if I have to put up a sheet and wait for the
> didEndSelector method to be called how do I carry on with the quit or close?

For -windowShouldClose:, simply return NO. Then when the sheet
finishes, close the window or do nothing as appropriate.

For -applicationShouldTerminate:, return NSTerminateLater. Then when
the sheet finishes, call -replyToApplicationShouldTerminate: with the
appropriate value.

Mike
_______________________________________________

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: 
 >Save changes prompt in non-document app (From: Andy Bettis <email@hidden>)

  • Prev by Date: Re: NSTask Leaking...
  • Next by Date: Re: Partially Transparent windows
  • Previous by thread: Save changes prompt in non-document app
  • Next by thread: CGAffintransform and UIImage Views
  • Index(es):
    • Date
    • Thread