Re: UndoManager doesn't work with saved documents
Re: UndoManager doesn't work with saved documents
- Subject: Re: UndoManager doesn't work with saved documents
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 13 May 2003 16:20:47 -0400
on 03-05-13 9:57 AM, Rob In der Maur at email@hidden wrote:
>
Thanks, but I sorted it out; I forgot to associate my data model after
>
loading it with the file content with the document itself, using:
>
>
// init the model after we unarchived
>
[[self chartData] initAfterUnarchivingWithDocument:self];
>
>
>
The initAfterUnarchivingWithDocument method in my model class actually
>
is very simple and looks like
>
>
- (void)initAfterUnarchivingWithDocument:(ChartDocument
>
*)inDocument
>
{
>
document = inDocument;
>
}
>
>
>
That did the trick. Got it from Cheeseman's excellent book 'Cocoa
>
Recipes'....
I recognized my code before I got to the last line of your message. Thanks.
To be clear about it: You don't have to do this post-unarchiving
initialization in a separate method. I did it that way in the book for
clarity. When it's as simple as this, there's no reason you can't do it in
the main unarchiving method, after the unarchiving is finished.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
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.