Re: NSKeyedArchiver - better ways to autosave documents?
Re: NSKeyedArchiver - better ways to autosave documents?
- Subject: Re: NSKeyedArchiver - better ways to autosave documents?
- From: Guy English <email@hidden>
- Date: Wed, 31 Aug 2005 18:00:10 -0400
>Programs managed to auto-save quickly before CoreData
>came along, so there must be another solution.
Instead of autosaving all the time you could keep a journal of what was done. When a file is added, log that, when a file is removed or moved in the list log that, etc. When you do a real save remove the journal. If you open a document and it's journal is still there then you probably crashed. Load the document as normal, run through the journal applying each change, resave immediately, and remove the journal. This way 'Autosave' should be quick and in a catastrophic case the user will only have to put up with a longer document load time. It also has the advantage that, no matter how big your document, saving off the actions will have a constant time.
This would work much easier if your document was a bundle but you could stash the journal in application support if needed.
Hope that helps,
Guy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden