Re: [Pyobjc-dev] NSCoding support for python list & dict
Brought to you by:
ronaldoussoren
|
From: Bill B. <bb...@ma...> - 2007-11-27 07:55:52
|
On Nov 26, 2007, at 9:59 PM, Ronald Oussoren wrote: > NSCoding support for other objects should also be doable, but is > more work and requires a lot of testing. Pickling Objective-C > objects on the other hand has the outlooks of being a very hard > problem. NSArchiver and NSKeyedArchiver support arbitrary archival of objects. That is, you can create an archiving session and then archive the sub- graphs of objects of objects in arbitrary order and with arbitrary references between the subgraphs. Pickling of a graph containing a mix of Python and Objective-C objects could be done by creating a UUID for each object in the graph at the pickle/archiver boundary. The UUID could be stored in the pickle, could be used to archive the sub-graph of Objective-C objects and store 'em away via -encodeObject:forKey:, and then the resulting BLOB of archived Objective-C data could be stored in the pickle as a <string>. Completely trivial, right? Only because of my ignorance. There is a definite chicken-and-egg problem in that archival will produce the archived obj-c objects *last* whereas unarchival will need them to be decoded *first*. And that is just scratching the surface. b.bum |