• 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: "Martin" <email@hidden>
  • Date: Mon, 28 Jun 2004 14:11:23 -0700

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.


  • Follow-Ups:
    • Re: Suppressing NSDocument's "unsaved changes" alert
      • From: Jeremy Dronfield <email@hidden>
  • Prev by Date: core data
  • Next by Date: Binary data
  • Previous by thread: Suppressing NSDocument's "unsaved changes" alert
  • Next by thread: Re: Suppressing NSDocument's "unsaved changes" alert
  • Index(es):
    • Date
    • Thread