title: iOS/iPhone SDK: initWithCoder and encodeWithCoder not being called
body: <p>I'm trying to save an <code>NSMutableArray</code> called queueArray so it can be loaded again after the app has been quit.  I used a few tutorials to get me going and this is the code I have come up with.  The problem seems to be that "<code>initWithCoder</code>" and "<code>encodeWithCoder</code>" are not being called, shown by no <code>NSLog</code> calls and no stopping at breakpoints.  I have added the <code>NSCoding</code> protocol to the .h file and I know that queueArray is not nil and it contains <code>MPMediaItem</code>s.  Here is some of the code I use to try to save and load the array:</p>
  
  <pre><code>-(IBAction)saveQueuePressed {
  
       NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
       NSString *filePath = [rootPath stringByAppendingPathComponent:@"queueArray.archive"];
  
       //should cause encodeWithCoder to be called
       [NSKeyedArchiver archiveRootObject:queueArray toFile:filePath];
  
  }
  
  -(IBAction)loadQueuePressed {
  
       NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
       NSString *filePath = [rootPath stringByAppendingPathComponent:@"queueArray.archive"];
  
       //should cause initWithCoder to be called
       queueArray = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath];
  
  }
  
  -(void)encodeWithCoder:(NSCoder *)coder {
  
       NSLog(@"encodeWithCoder");
  
       [coder encodeObject:queueArray forKey:@"savedQueueArray"];
  }
  
  
  
  -(id)initWithCoder:(NSCoder *)decoder {
  
       NSLog(@"initWithCoder");
  
       queueArray = [decoder decodeObjectForKey:@"savedQueueArray"];
  
       return self;
  
  }
  </code></pre>
  
  <p>Any help will be greatly appreciated!</p>