Re: Bunch of CoreData based NSDocument questions.
Re: Bunch of CoreData based NSDocument questions.
- Subject: Re: Bunch of CoreData based NSDocument questions.
- From: Motti Shneor <email@hidden>
- Date: Fri, 27 Nov 2015 08:41:01 +0200
Thanks Ernesto. Of course I cleanup. That's not my problem. I want to DENY the quit. I want the user to be asked, and be able to cancel the quit - because the USER is in the middle of an important action, despite the fact the document is autosaved, and can be safely closed.
I am not worried about document integrity - rather on User's health.
There is more to "preserving state" than just saving documents. In my case, user calibrates a microscope (half an hour's work), brings a sample, and drives it carefully until he sees what's to be measured (onscreen, on one of my document windows), then starts measuring some creature, then...
He hits "Quit" by mistake, and the whole thing pops and disappears. He'll have to open the application and re-do half an hour's work to bring his setup to the previous state. Nothing was yet saved - because most of this work is outside the computer. Only the user can align these two simultaneous flows of action.
So -- I MUST warn him and allow him to cancel this quit command. unfortunately, the @$@$@ NSDocument architecture insists I'm not to be involved, and shortcuts even the ApplicationDelegate "applicationShouldTerminate" for me, happily autosaving what's dirty, and quitting immediately.
I am very frustrated with this, and I fail to see where to "override" to change this behavior. In the past Apple engineers were modest enough to design their system flexible enough for different uses. Now, much like old Microsoft - they just decide what's best for you - and enforce.
I really wish someone from Apple would help here on this list.
On 23 בנוב 2015, at 12:04, Ernesto Giannotta wrote:
> Have you tried this (in your Persistent document subclass)?
>
> - (void)close
> {
>
> // we're about to close this document but we have to do some housekeeping
> [self cleanup];
> [super close];
>
> }
>
>> On 23-Nov-2015, at 07:41, Motti Shneor <email@hidden> wrote:
>>
>> Problem is - the application quits immediately even when there are dirty documents open!!! the @#$@#$ document "architecture" feels free to quit because all has been "AutoSaved". not "Saved". I just want the old behavior - you should not be able to quit with dirty documents. That's all.
>>
>> I do have, of course, validation on saves (Hmmm.... CoreData has, and I added my overrides). But happy-happy-document-architecture doesn't really care.
>>
>>
>
> Cool Runnings,
> Erne.
Motti Shneor
---------------------------------------------------------
Ceterum censeo Microsoftinem delendam esse
_______________________________________________
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