I have a mainObjectArray (NSMutableArray) which is populated with instances of a custom class. Each instance is itself an array, and objects in each array are NSDates, NSStrings, BOOL, and more arrays containing similar objects.
What I haven’t been able to establish is whether it’s possible to, inside the
- (void)encodeWithCoder:(NSCoder *)encoder
method, to just say something like that:
[encoder encodeWithObject:mainObjectArray];
Or do have to encode every object in every instance separately? This would be a bit of a pain…
Your help would be very much appreciated.
Just implement the encoding and decoding methods in your custom class. That will do. Some sample,
You can see totally three data types being encoded and decoded – int, string, array.
Hope this helps.