title: Storing NSMutableArray to NSUserDefaults
body: <p>First of all: Merry Christmas everyone! It has been some time since I was able to store data into NSUserDefaults. </p>
  
  <p>In this case I want to store a NSMutableArray to the NSUserDefaults. It is clear to me that you can only store immutable objects to this "file". </p>
  
  <p>I had tried the following code for loading the NSMutableArray: </p>
  
  <pre><code>NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  self.mutableArray = [[NSMutableArray alloc] initWithArray: [defaults objectForKey:@"TestKey"]];
  </code></pre>
  
  <p>I am using the following code for storing the data:</p>
  
  <pre><code>NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  NSArray *tempArr = [NSArray arrayWithArray:self.mutableArray];
  [defaults setObject:tempArr forKey:@"TestKey"];
  [defaults synchronize];
  </code></pre>
  
  <p>Unfortunately, the simulator exits with the following error:</p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSUserDefaults setObject:forKey:]: attempt to insert non-property list object (
  "&lt;MyObject: 0x10dfb40a0&gt;"
  ) for key TestKey'
  </code></pre>
  
  <p>The mutable array contains NSObjects.</p>
  
  <p>Does anyone have a clue where I am screwing up?</p>