• 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
Dumb App Quitting Questoin
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dumb App Quitting Questoin


  • Subject: Dumb App Quitting Questoin
  • From: Tom Gray <email@hidden>
  • Date: Tue, 10 Dec 2002 11:19:29 -0500

As always, thanks in advance!

When my application quits my non-NSDocument window (a subclass of NSWindowController ) is not prompting to "save" changes prior to closing.

If I register to receive NSApplicationWillTerminateNotification I can prompt the user to "save" the document. However, I am not sure how I can "cancel" the pending "quit".

If I make my non-NSDocument window the application's delegate I can implement applicationShouldTerminate and do what I want (allow the user to save the document or cancel the quit).

It strikes me as being "wrong" to have my non-NSDocument window as the Application's delegate.

Obviously, I was sleeping in class when this was covered.

So, what is the correct way to have my non-NSDocument window (a subclass of NSWindowController ) be notified that the application is quitting and allow the user to cancel the quit.

Tom Gray
-------------
email@hidden
or
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Drawing a view inside an image
  • Next by Date: Re: Drawing a view inside an image
  • Previous by thread: Re: Setting the image on a pop up button
  • Next by thread: Dirty dot in close button
  • Index(es):
    • Date
    • Thread