• 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: Suppressing NSDocument's "unsaved changes" alert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suppressing NSDocument's "unsaved changes" alert


  • Subject: Re: Suppressing NSDocument's "unsaved changes" alert
  • From: Jeremy Dronfield <email@hidden>
  • Date: Tue, 29 Jun 2004 09:24:49 +0100

Thanks Martin! I'd overlooked that one. Works nicely.

(I really wasn't looking forward to rewriting this app...)

Regards,
-Jeremy


On 28 Jun 2004, at 10:11 pm, Martin wrote:

Jeremy,

To disable the default close/save alert panel you will want to override the method

- canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:

in NSDocument, and not call super's implementation. Just throw up your own dialog and call the shouldCloseSelector depending.

~Martin


On June 28 2004, Jeremy Dronfield <email@hidden> wrote:

This seems like it should be easy, but I can't find a solution. I have
a document-based application in which each document (representing a
project) manages its constituent source files in a manner similar to
Xcode. When the user tries to close the document window or quits, they
are (or should be) presented with a "Save All" window which lists any
unsaved files (again, similar to Xcode).

The problem is that NSDocument's default alert panel always butts in,
and I can't find a way to disable it. I've burrowed through the chain
of methods called during window closing and application termination,
but can't find any point at which I can choke this wretched little
panel. Is there a way to do this, or am I going to have to go back and
rewrite my application without the Cocoa document architecture?

Regards,
-Jeremy
_______________________________________________
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.


References: 
 >Re: Suppressing NSDocument's "unsaved changes" alert (From: "Martin" <email@hidden>)

  • Prev by Date: Re: Projects interaction
  • Next by Date: Re: Projects interaction
  • Previous by thread: Re: Suppressing NSDocument's "unsaved changes" alert
  • Next by thread: Accessing Audio CD info from CD-ROM
  • Index(es):
    • Date
    • Thread