Skip navigation.
 
mlRe: Array Problems
FROM : Serge Meynard
DATE : Sun Apr 10 20:30:58 2005

On Apr 10, 2005, at 13:58, David Rocamora wrote:
> I'm pretty new to Cocoa and Objective-C so I imagine this problem is
> pretty easy to solve for an expert, but I am stumped.  I have a
> document based program that needs to save a NSMutableArray of objects
> to a file using NSArchiver. Everything is compiling without errors or
> warnings and when I run the program it appears to be saving. When I
> load the data back from the file It only has one entry in the array.
> This entry also does not contain any of the changes that were made to
> it.
>
> My first thoughts were that the array was somehow not having anything
> added to it. So I used an NSLog to display the contents of the array
> in every method that did something to the array. The correct data is
> in all of the methods I wrote (as well as init), but not in methods
> like dataRepresentationOfType or dealloc.
>
> I hope someone has some pointers to help me figure this out.
>
> Thanks in advance,
> Dave


It might help if you posted the significant sections of your code...
How are you doing the load and save exactly?

By the way, you should probably be using NSKeyedArchiver instead of
NSArchiver.

Related mailsAuthorDate
mlArray Problems David Rocamora Apr 10, 19:58
mlRe: Array Problems Serge Meynard Apr 10, 20:30
mlRe: Array Problems David Rocamora Apr 10, 22:03
mlRe: Array Problems Shawn Erickson Apr 10, 22:23
mlRe: Array Problems David Rocamora Apr 10, 22:56
mlRe: Array Problems Serge Meynard Apr 11, 00:00
mlRe: Array Problems David Rocamora Apr 11, 00:34
mlRe: Array Problems Serge Meynard Apr 11, 00:45
mlRe: Array Problems David Rocamora Apr 11, 01:22
mlRe: Array Problems Serge Meynard Apr 11, 01:59
mlRe: Array Problems mmalcolm crawford Apr 11, 03:37
mlRe: Array Problems David Rocamora Apr 11, 18:01