Writing a file type
Writing a file type
- Subject: Writing a file type
- From: Rob Rix <email@hidden>
- Date: Sun, 2 Sep 2001 04:24:55 -0400
Greetings, all.
In a project that I'm working on, I'm going to want to archive data to a
file. So, I've read up on NSArchiver and NSUnarchiver and NSSerializer, et
cetera, and the NSCoding protocol.
Problem is, I want to write to a bundle, not a flat file. The bundle would
contain files for various objects and also resources that they share. So,
it would be analogous to the .rtfd file format that TextEdit handles.
So far, it seems to me that my options are limited to writing my own coder
class or making odd use of NSArchiver (archiving objects individually, not
as a graph) and then doing some severe messing about during unarchiving.
Since the latter seems implausible (not merely hackish), I'd guess that
leaves me with writing a coder. So, what I want to know is, any comments?
Is there something easier I could be doing?
Any notes on writing coders in general?
Any coder sample code out there?
Thanks very much,
-- Rob
Vous Sortez du Secteur Canadien