Re: -saveDocument: and package problems
Re: -saveDocument: and package problems
- Subject: Re: -saveDocument: and package problems
- From: Keith Blount <email@hidden>
- Date: Wed, 20 Feb 2008 09:58:46 -0800 (PST)
Yes, because that would require returning an NSFileWrapper built from all of the documents in the project, meaning that potentially hundreds of files would get written to disk. So I override -saveDocument: so that I can write only what's necessary and have complete control. (Likewise, I used to use -readFromFileWrapper:... until I realised that that loaded the whole project directory to memory - meaning that hundreds of megabytes could be loaded up - when all I needed was a few internal files, so I went with -readFromURL:... instead).
Thanks for your reply.
All the best,
Keith
----- Original Message ----
From: Benjamin Stiglitz <email@hidden>
To: Keith Blount <email@hidden>
Cc: email@hidden
Sent: Wednesday, February 20, 2008 3:30:31 PM
Subject: Re: -saveDocument: and package problems
>
To
save
the
package,
I've
overridden
NSDocument's
-saveDocument:.
It
>
doesn't
call
super's
method
at
all
-
all
it
does
is
write
any
text
>
files
that
have
been
marked
as
changed
into
the
project
package
as
>
RTFD
files
and
saves
the
project
dictionary
file.
Is
there
any
reason
you’re
not
using
-fileWrapperOfType:error:
and
letting
the
document
machinery
handle
things
for
you?
-Ben
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden