Usage of NSKeyedArchiver
Usage of NSKeyedArchiver
- Subject: Usage of NSKeyedArchiver
- From: Mike Abdullah <email@hidden>
- Date: Fri, 31 Mar 2006 01:24:46 +0100
I am experimenting with usage of NSKeyedArchive in my app and so far
things are going pretty well. However, I want to make sure I don't
get off on the wrong foot.
Basically my app/document contains an array of myObject that the user
modifies.
What I want to do is create an archive of the last 4 or 5 myObjects
that have been used and store this on disk (preferably within my
app's prefs file). Then, when the user is making a new myObject in
the future, they have the option to either make a new "blank"
myObject, or one they used recently.
I have implemented encodeWithCoder: in myObject and using
NSKeyedArchiver can successfully place the thing on disk.
So, basically what this boils down to is, is NSKeyedArchiver the man
for the job?
When I look at the file produced by my experimental
archiveRootObject:toFile: things aren't as simple as I had expected -
there's a lot of "mysterious" values in there which seem to be part
of how NSKeyedArchiver works.
If I store this in my plist file, I want to be able to retrieve a
string "summary" of myObject without actually instanciating
myObject. Should I still use NSKeyedArchiver for this and store the
summary string outside of the NSKeyedArchiver result and just
"associate" the two in the plist?
Mike.
_______________________________________________
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