I have an object containing various NSString objects and variables, which I find for NSCoding to archive to a file on disk, and then using unarchive. So far, everything is working fine.
Today I wanted to add NSMutableArray to an object and tried to code using:
[encoder encodeObject:myArray ForKey:@"myArray"];
and then decode it using:
[self setMyArray:[decoder decodeObjectForKey:@"myArray"]];
It does not work, and until I get any errors in the encoding or decoding itself, I get an error message if I try to change the value of the array after decoding from the file.
I'm sure I'm doing something completely wrong here, but not quite sure what. I think it is possible that this may have something to do with this, not highlighting correctly during unpacking.
Does anything look clearly obvious as the source of the problem?
source share