Re: Save changes prompt in non-document app
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