title: How to convert an NSString into an NSNumber
body: <p>How can I convert a <code>NSString</code> containing a number of any primitive data type (e.g. <code>int</code>, <code>float</code>, <code>char</code>, <code>unsigned int</code>, etc.)? The problem is, I don't know which number type the string will contain at runtime.</p>
  
  <p>I have an idea how to do it, but I'm not sure if this works with any type, also unsigned and floating point values:</p>
  
  <pre><code>long long scannedNumber;
  NSScanner *scanner = [NSScanner scannerWithString:aString];
  [scanner scanLongLong:&amp;scannedNumber]; 
  NSNumber *number = [NSNumber numberWithLongLong: scannedNumber];
  </code></pre>
  
  <p>Thanks for the help.</p>