Re: Hierarchal Archiving
Re: Hierarchal Archiving
- Subject: Re: Hierarchal Archiving
- From: Don Murta <email@hidden>
- Date: Tue, 28 Jan 2003 14:57:55 -0700
Take your custom class and implement the initWithCoder (so you can
load) and encodeWithCoder so you can save, then both the archiving
methods will work, and I would assume the dictionary would work as well
since the type knows how to write and read itself. See the NSCoding
protocol and specifically the encoding and decoding of c data types (i
assume your arrays of arrays are not NSArrays), of the Archives and
Serializations section. With 2+d arrays it might be simpler to convert
them to a 1d array, write a vector lookup function, and use that in
place of a multi-dimensional array, but that all depends on what your
doing.
Definitely read the Cocoa Developer Documentation > Data Management >
Archives and Serializations section of the Foundation docs though.
hope that helps.
don
On Tuesday, January 28, 2003, at 11:21 AM, The Amazing Llama wrote:
I am programming a document that needs to save it's data to disk, like
any good document.
The data in question is a dictionary whose keys are names (NSStrings)
and whose objects are a custom class I have coded, whose instances
store arrays of arrays of numbers. How do I write this to disk? The
options I know of are:
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.