Re: problems with "Graceful Application Termination"
Re: problems with "Graceful Application Termination"
- Subject: Re: problems with "Graceful Application Termination"
- From: Amilcar Meneses Viveros <email@hidden>
- Date: Mon, 22 Mar 2004 07:33:19 -0600 (CST)
Hello all
Some weeks ago a had a problem with "Graceful Application Termination"
(it's a document in
/Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/
AppArchitecture/Tasks/GracefulAppTermination.html
)
The problem that a had: my document-based application didn't like
close document propertly, --I mean, when you press CTRL-W and your
document is edited, it would be a mechanis to advertise to the user
that he could lost his work, or when the user quit from the application it
would be a mechanism for searching edited document and send a message to
the user for save or los his work--. Anyway, the documentation say:
"the good news is that you have to do absolutely nothing to effect a
graceful termination of the application. This 'free' behavior is
implemented largely in NSDocumentController"
...well and now I know that it's true.
I rewrote the method "isDocumentEdited" from myDocument class and I
implement the mechanism for decide when the document is edited and
all work perfectly.
For example, in myDocumentClass.m
- (BOOL)isDocumentEdited
{
return [[windowController window] isDocumentEdited];
}
And in myView.m I wrote some like that
- (void)setDocumentEdit:(BOOL)aFlag
{
[[self window] setDocumentEdited: YES]
}
That all.
Regards!
Amilcar
_______________________________________________
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.