Re: Property List Question
Re: Property List Question
- Subject: Re: Property List Question
- From: Karl Goiser <email@hidden>
- Date: Thu, 17 May 2001 08:35:25 +1000
Thanks for the replies people!
Here are my responses:
Just make the people objects NSDictionary and then create an NSArray
of people. Then when you write it out, it will write it properly.
I haven't tried this, but I know it works with CoreFoundation, which
is what the NS stuff is based on. (or perhaps it is the other way
around)
I tried that and got an error saying that dictionary is an abstract
type and that I had to implement setObject myself. Sounds too hairy
for me!
...
The property list methods allow storage of NSData objects, right? If
so, you could try using NSArchiver's archivedDataWithRootObject:
method to serialise the object into an NSData object, which you
could then store in the array.
This would mean that I would have to take my internal structure and
copy it into another temporary structure and save that off...
That sort-of defeats the simplicity of the property list methods.
...
Maybe not quite what you're after, but (as is so often the case) I
suspect looking at the source code to Sketch will prove instructive.
In particular look at the propertyListRepresentation methods...
They seem to go the temporary structure route which it looks like I
will have to follow too!
You know, all they need to do is have a protocol which requires your
objects to be translatable between NSArray, NSString or NSDictionary
objects and everybody could take advantage of the inherent property
list methods!
Ah well, back to the grind.
Karl
--
----
Klaatu verada nikto