title: Convert contents of NSString to bytes they represent
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2501033/nsstring-hex-to-bytes">NSString (hex) to bytes</a>  </p>
  </blockquote>
  
  
  
  <p>I'm currently stuck trying to convert the contents of a <code>NSString</code> to a byte.</p>
  
  <p>My program receives a string, for example <code>CC</code> to a byte <code>0xCC</code></p>
  
  <p>I understand that you can convert an <code>NSString</code> to its hex representation, but this isn't what I need, as that uses the string encoding -- my <code>CC</code> would turn out as <code>0x63</code>.</p>
  
  <p>From what I understand, I need to cast the <code>NSString</code> (or <code>char</code>) to a raw byte, so that I can then later on convert it to a decimal but i'm getting really confused on how to do it.</p>