title: iOS NSDictionary saved to NSUserDefaults not saving values
body: <p>I am trying to save a <code>NSDictionary</code> with array values to <code>NSUserDefaults</code> but am having some strange trouble.</p>
  
  <p>My <code>NSDictionary</code> has <code>NSStrings</code> for <code>keys</code> and each <code>value</code> is a <code>NSArray</code> of <code>NSNumbers</code>. When I print the dictionary out, everything is fine. I write this dictionary to <code>NSUserDefaults</code> and if I read it back out right away, everything seams fine. Using this everything seams just fine:</p>
  
  <pre><code>[[NSUserDefaults standardUserDefaults] setObject:self.selectedOptionPositions 
                                            forKey:PREF_OPTIONS_KEY];
  [[NSUserDefaults standardUserDefaults] synchronize];
  
  //THIS PRINT EVERYTHING OUT EXACTLY AS IT SHOULD!       
  NSLog(@"read after write: %@", [[NSUserDefaults standardUserDefaults] 
                                   objectForKey:PREF_OPTIONS_KEY]);
  </code></pre>
  
  <p>The problem comes when I create a new instance of the class that handles this. When I make a new instance of the class and in the init method check the <code>NSDictionary</code> like so:</p>
  
  <pre><code>NSLog(@"read initial: %@", [[NSUserDefaults standardUserDefaults] 
                                objectForKey:PREF_OPTIONS_KEY]);
  </code></pre>
  
  <p>When I print that logging, the <code>NSDictionary</code> contains all of the <em>keys</em> but all of the <code>values</code> are now empty! All newly added <code>keys</code> exist after recreating the class, but no <code>values</code> persist.</p>
  
  <p>What could be wrong here? There are no warnings or errors in the console.</p>