FROM : Gordon Apple
DATE : Thu Jan 10 19:25:47 2008
I've been through that document twice and it still doesn't explain why
you would want one or the other. I finally tossed Sketch's property lists
and just went with archiving for cut/copy/paste/drag/drop, since I already
had that for file storage. It works, and it was a lot simpler.
What I was really trying to get at is whether or not the property list
approach was preferred for attempts at commonality between applications.
I really wish there was some standard list for keyed graphic properties
that would promote commonality across applications, instead of everyone
rolling their own.
> Le 10 janv. 08 à 04:52, Gordon Apple a écrit :
>
>> Sketch uses property list serialization rather than
>> encodeWithCoder,
>> encodeObject:forKey:, etc. Is there any particular advantage/
>> disadvantage
>> to this? Don't they ultimately do the same thing? If it is to set
>> up all
>> the KVOs, couldn't the same thing be done either way?
>>
>> I should mention that I use only one type of graphic object class
>> for
>> everything, differentiated only by the content of a properties
>> dictionary.
>> (In fact, now that I've done it, I don't know why I didn't just make
>> that
>> class a subclass of NSMutableDictionary.)
>
> encodeWithCoder: is for archiving, NSPropertyList is for serialization:
> The two solution are valid and do not do the same thing. The
> difference is discussed here:
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/Concepts/o
> bjectgraphs.html
>
DATE : Thu Jan 10 19:25:47 2008
I've been through that document twice and it still doesn't explain why
you would want one or the other. I finally tossed Sketch's property lists
and just went with archiving for cut/copy/paste/drag/drop, since I already
had that for file storage. It works, and it was a lot simpler.
What I was really trying to get at is whether or not the property list
approach was preferred for attempts at commonality between applications.
I really wish there was some standard list for keyed graphic properties
that would promote commonality across applications, instead of everyone
rolling their own.
> Le 10 janv. 08 à 04:52, Gordon Apple a écrit :
>
>> Sketch uses property list serialization rather than
>> encodeWithCoder,
>> encodeObject:forKey:, etc. Is there any particular advantage/
>> disadvantage
>> to this? Don't they ultimately do the same thing? If it is to set
>> up all
>> the KVOs, couldn't the same thing be done either way?
>>
>> I should mention that I use only one type of graphic object class
>> for
>> everything, differentiated only by the content of a properties
>> dictionary.
>> (In fact, now that I've done it, I don't know why I didn't just make
>> that
>> class a subclass of NSMutableDictionary.)
>
> encodeWithCoder: is for archiving, NSPropertyList is for serialization:
> The two solution are valid and do not do the same thing. The
> difference is discussed here:
>
> http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/Concepts/o
> bjectgraphs.html
>
| Related mails | Author | Date |
|---|---|---|
| Gordon Apple | Jan 10, 04:52 | |
| Jerry Krinock | Jan 10, 06:03 | |
| Jean-Daniel Dupas | Jan 10, 10:30 | |
| Gordon Apple | Jan 10, 19:25 | |
| Gordon Apple | Jan 10, 20:13 |






Cocoa mail archive

