• 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: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating


  • Subject: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • From: Markus Spoettl <email@hidden>
  • Date: Mon, 23 Jul 2012 23:49:54 +0200

On 7/23/12 9:34 PM, Kevin Perry wrote:
If there would be a way to tell NSDocument to forgo asking whether to save
a document if -isDocumentEdited returned YES, and instead just save it,
that would be a solution. All I want is a silent save, when only
preferences need to be saved (since I'm using file wrappers it would be
quick too because I'm only replacing the wrapper for my preferences).

I don't see how I could do that. Is there a way?

You're talking about the "Do you want to save changes to this document"
dialog when clicking the close button or quitting? The only way to bypass
that is to override canCloseDocumentWithDelegate:… check for your special
"-isDocumentEdited==YES, but don't show a panel" case, and invoke the
shouldCloseSelector (after writing the preferences file) without calling
super.

Thanks, I'll see if I can make this work, I'll report back.

Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________

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: 
 >NSDocument -canCloseDocumentWithDelegate::: not called when terminating (From: Markus Spoettl <email@hidden>)
 >Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating (From: Kyle Sluder <email@hidden>)
 >Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating (From: Markus Spoettl <email@hidden>)
 >Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating (From: Kevin Perry <email@hidden>)

  • Prev by Date: Re: Profound UITableView rendering-performance problem, but only at certain positions?
  • Next by Date: Forcing Core Data to save attribute changed behind its back?
  • Previous by thread: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Next by thread: Badge drawing like NSDockTile
  • Index(es):
    • Date
    • Thread