title: How to store a float in NSUserDefaults
body: <p>I want to store a <code>float</code> value into <code>NSUserDefaults</code>.</p>
  
  <p>I also need to check that the float value exists..if not I need to assign some value in it.</p>
  
  <p>and retrieve it...for the above I have the below code but it gives me an error.</p>
  
  <pre><code>NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
  
  if ([defaults boolForKey:@"HANDWRITING_SIZE_SLIDER"] == YES) {
    self.sizeSlider.value = 10.0;
  } else {
    self.sizeSlider.value = [[NSUserDefaults standardUserDefaults] floatForKey:@"HANDWRITING_SIZE_SLIDER"]];      
  }
  </code></pre>
  
  <p>Thanks for any help</p>