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: Wed, 31 Aug 2005 13:57:11 -0700 (PDT)
Many thanks again for the reply. I don't really want
to go the core data route at this point - my program
is nearly finished and I don't want to have to go
through the whole thing and reprogram it to use Core
Data, which would also take me a couple of months on
top to learn.
Programs managed to auto-save quickly before CoreData
came along, so there must be another solution. Xcode
saves the state of its projects and DevonThink saves
files whenever they are added to the project without
any speed hit. There must therefore be a way of saving
changes to an Xcode-esque project without incurring
the speed hit of NSKeyedArchiver.
As ever, if anyone has any suggestions, I would be
most grateful.
All the best,
Keith
--- ORIGINAL MESSAGE ---
FROM : Will Mason
DATE : Wed Aug 31 07:21:15 2005
Yeah, sorry I couldn't be more helpful. Believe me,
I'm as frustrated
by NSKeyedArchiver as anyone who uses would be. I've
filed bugs against
it, but there has not been any response so far.
Shot in the dark: I've never used CoreData, but that
might be a better
way to go. After all, they're obviously putting a
great deal of effort
into it while not putting any discernible effort into
keyed archives.
Maybe you should check it out.
Just a thought,
Will
--- Keith Blount <<email_removed>> wrote:
> 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:
> >
>
>
____________________________________________________
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden