FROM : Don Murta
DATE : Tue Jan 28 22:57:55 2003
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Jan 28 22:57:55 2003
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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| The Amazing Llama | Jan 28, 19:21 | |
| j o a r | Jan 28, 21:25 | |
| Don Murta | Jan 28, 22:57 | |
| Lorenzo Puleo | Jan 29, 00:57 |






Cocoa mail archive

