Re: NSKeyedArchiver - better ways to autosave documents?
Re: NSKeyedArchiver - better ways to autosave documents?
- Subject: Re: NSKeyedArchiver - better ways to autosave documents?
- From: Keith Blount <email@hidden>
- Date: Tue, 30 Aug 2005 15:01:13 -0700 (PDT)
Thanks for the reply - I think I saw a post from you
in the past on this, I guess you had the same
problem... Trouble is, as you say, NSArchiver has been
deprecated since 10.2 (and it's more awkward to
maintain compatibility between program versions).
There must be a solution to this that I am missing, as
a number of programs auto-save without such a
performance hit. At the moment, I save my Xcode-esque
interfaced program whenever a new file or virtual
folder is added or when a document is dragged and
dropped to a new position in the outline view. When
there are 500 or so files or folders, there is a pause
of a few seconds while waiting for the file to save in
these situations, which is not pretty.
(I don't want the user to have to manually save, as it
makes more sense for save to affect only the
currently-selected file in the editor.)
If anyone has a better way of approaching this, I
would be very grateful.
Many thanks,
Keith
P.S. Apologies for the post title-change, but I
figured the new post title better reflects the
question.
---
FROM : Will Mason
DATE : Tue Aug 30 14:55:16 2005
NSArchiver performs significantly better than
NSKeyedArchiver - in some
of my tests more than 100 times better. I've always
just been annoyed
by NSKeyedArchiver, since sometimes it feels like I
can type binary
numbers faster than it can write them.
Good luck, especially after NSArchiver becomes fully
deprecated,
Will
--- Keith Blount <<email_removed>> wrote:
> Hello,
>
> This is a question that has been asked before, I
know,
> but my searches of the archives and CocoaDev have
only
> found lots of questions and no real solution...
>
> I have an app that works a little like Xcode: it has
> an outline view that represents virtual folders and
> text files. Whenever the user adds a new text file,
it
> is saved within the document's file wrapper as an
RTFD
> file, and the contents of the outine view (an array
of
> root-level node model objects, each of which keep an
> array of children) is saved to disk using
> NSKeyedArchiver. This way, the project is auto-saved
> each time a document is added.
>
> The problem is that - as has been noted a number of
> times - NSKeyedArchiver is *slow*. Once I have about
> 700 odd files in my project, if I click my "add
> document" button, it takes a few seconds to respond
-
> because NSKeyedArchiver is taking so long to save
all
> the data to disk.
>
> Is there a better way to do go about this that will
be
> faster? My model object mostly contains strings and
> ints, but it also contains an NSImage, so isn't
really
> suitable for property list serialization (I think -
> though I was left baffled by the documentation on
> property list serialization, I fully admit).
>
> Many thanks in advance for any suggestions,
> Keith
>
>
>
> ____________________________________________________
> Start your day with Yahoo! - make it your home page
> http://www.yahoo.com/r/hs
>
> _______________________________________________
> Do not post admin requests to the list. They will be
ignored.
> Cocoa-dev mailing list (<email_removed>)
> Help/Unsubscribe/Update your Subscription:
>
>
> This email sent to <email_removed>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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