In article <400fc6ab$0$24649$arcor-online.net>,
"Florian Zschocke" <de> wrote:
The easiest way is to use NSCoder. See the docs on NSCoder, NSArchiver,
NSKeyedArchiver, NSUnarchiver, and NSKeyedUnarchiver. The short version:
write -initWithCoder: and -encodeWithCoder: methods for every class you
want to save to a file. (They're pretty easy to make.) Then your class
can be encoded, so you can easily transform an arbitrary object graph to
an NSData and vice versa using the classes I mentioned.
There are a couple of downsides, mainly that you have no control over
the format of the resulting file, which isn't doented, and therefore
the files aren't portable to other APIs. If you just want to load/save
files on the Mac, you're fine.