• 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: Tue, 24 Jul 2012 20:04:33 +0200

On 7/23/12 6:27 PM, Markus Spoettl wrote:
On 7/23/12 5:42 PM, Fritz Anderson wrote:
Perhaps I'm missing something — is writing the preferences file very
time-consuming? If not, why not write it whether you need to or not? Or
whenever a preferences value changes, which is what you'd do with
NSUserDefaults?

Thanks for your suggestion. Writing is fast, so I guess I could write in -close.
I'd prefer not to write if it's not necessary and it seems I can detect that
case reliably because -canCloseDocumentWithDelegate::: will be called if there
are unsaved changes and -close is called from within
-canCloseDocumentWithDelegate::: in that case. That could break in the future,
though.

Despite the future breakage risk I've decided to go with this solution. I'm not using versions, autosave, sudden termination or iCloud at this point, so modifing the package at the time the document is guaranteed to be finished with its wrapper seems reasonably safe. Autosave has some nice features but overall it doesn't seem worth the unavoidable trouble. My documents can get huge, saving may take long, even making snapshots can take long (I do use asynchronous saving and loading). Saving cancelability gives me a headache.

Thanks for the suggestion, guys!

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

  • Prev by Date: Re: Is it 'normal' that scrolling in a UIScrollView leaks some bytes?
  • Next by Date: Why is NSDocument reverting so rudimentary?
  • Previous by thread: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Next by thread: Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating
  • Index(es):
    • Date
    • Thread