title: ios saving and retrieving NSNumber from NSUserdefaults
body: <p>I've searched but I can't find a good explanation as to why I'm still not getting the right value from my saved Integer. </p>
  
  <p>This is how I saved my event Id. </p>
  
  <pre><code>NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
  [prefs setInteger:eventSelected.eventId forKey:@"currentEvent"];
  </code></pre>
  
  <p>This is how I'm trying to retrieve it.</p>
  
  <pre><code>NSLog(@"user dfault %@", [NSNumber numberWithUnsignedInt:[[[NSUserDefaults standardUserDefaults] objectForKey:@"currentEvent"] unsignedIntegerValue]]);
  </code></pre>
  
  <p>I'm gettin gthis.</p>
  
  <blockquote>
    <p>user dfault 123581200</p>
  </blockquote>
  
  <p>Also, to note, event if I did <strong>intValue</strong> instead of <strong>unsignedIntegerValue</strong> , it would still give me a random id number. was wondering what I'm doing wrong.</p>