title: Convert string to int-objective c
body: <p>I haven't been able to figure out how to convert a NSString to an int. I'm trying to convert ASCII to text, but to do that I need to convert a string to an int.</p>
  
  <p>I find it really strange that this isn't anywhere online or in stack overflow. I'm sure I'm not the online one who needs this.</p>
  
  <p>Thanks in advance for helping.</p>
  
  <p>P.S. If this helps here is the code I'm using to convert to ASCII:</p>
  
  <pre><code>+ (NSString *) decodeText:(NSString *)text {
      NSArray * asciiCode = [text componentsSeparatedByString:@"|"];
      int i = 0;
      NSMutableString *decoded;
  
      while (i &lt; ([asciiCode count]-1) ) {
  
          NSString *toCode = [asciiCode objectAtIndex:i];
          int codeInt = toCode;
          NSString *decode = [NSString stringWithFormat:@"%c", codeInt];
          [decoded appendString:decode];
  
      }
  
      return decoded;
  }
  </code></pre>