• 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: Kyle Sluder <email@hidden>
  • Date: Mon, 23 Jul 2012 09:22:13 -0700

On Jul 23, 2012, at 8:12 AM, Markus Spoettl <email@hidden> wrote:

> Are there better options to do a last-minute save? I do not want to change the design, meaning I don't want preferences to contribute to the change count state or even worse be undoable. Plus I do want the preferences to be stored in the package, not someplace else (restoration state for example).

I don't have my crazy autosave flowchart handy, but I *think* you should be able to simply override -hasUnautosavedChanges to return YES if either super returns YES or if your preferences file needs to be saved. -autosaveWithImplicitCancellability:: is documented to check -hasUnautosavedChanges, so I would assume that it is called unconditionally at all places where AppKit wants to ensure the document is written to disk if necessary.

Of course, this assumes you are returning YES from +autosavesInPlace.

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
      • From: Markus Spoettl <email@hidden>
References: 
 >NSDocument -canCloseDocumentWithDelegate::: not called when terminating (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Next by Date: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Previous by thread: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Next by thread: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Index(es):
    • Date
    • Thread