So far I have the following:
- (id)initWithCoder:(NSCoder*) coder
{
self = [super initWithCoder: coder];
if (self) {
// Call a setup method
}
return self;
}
Am I supposed to put the code to load the array in here? What could should I put and where should I put it?
You put
myArray=[coder decodeObjectForKey:@"myArray"];inside the if block.If you haven’t set up the encoding part of the code yet, to do that you just add a method: