title: How To Convert UITextField value Into NSNumber?
body: <p>I've tried to convert the UITextfield Value Into a float first then convert it to an NSNumber but that doesn't seem to work as seen below.</p>
  
  <pre><code>       float carb = [self.carbGrams.text floatValue];
         NSLog(@"%.2f", carb);
         nCarbGrams = carb;
  </code></pre>
  
  <p>In the last line I get this error message:</p>
  
  <p>Assigning to 'NSNumber *__strong' from incompatible type 'float'</p>
  
  <p>I've then just tried assigning carb as an NSNumber by doing this</p>
  
  <pre><code>      NSNumber *carb = [self.carbGrams.text floatValue];
        NSLog(@"%.2f", carb);
        nCarbGrams = carb;
  </code></pre>
  
  <p>But I get this error message instead :</p>
  
  <p>Initializing 'NSNumber *__strong' with an expression of incompatible type 'float'</p>
  
  <p>As I've read I though NSNumber could accept any type of numeric value but I seem to be incorrect, can someone please evaluate the problem?</p>