title: Convert Hex String into unsigned char[]
body: <p>I am asking this question mainly because I have searched through this site for possible solutions and none have worked out the way I hoped. </p>
  
  <p>I would like to perform converting this Hex String into an unsigned char[].</p>
  
  <p><code>NSString *text = @"0043600001";</code> into
  <code>unsigned char dataSmall[] = {0x00, 0x43, 0x60, 0x00, 0x01}</code> </p>
  
  <p>I need the hexadecimal representation <strong>0x##</strong> because I am sending a host that accepts messages in <code>hexadecimal format</code> only. Am I right to say, I too need <code>NSScanner</code> to perform these steps to separate 2 characters? Really lost and confused on what I need to do. </p>
  
  <p>This are the steps to connect and send the hexadecimal message to the host:</p>
  
  <pre><code>unsigned char dataSmall[] = {0x00, 0x43, 0x60, 0x00, 0x01}
  NSData *data = [NSData dataWithBytes:dataSmall length:sizeof(dataSmall)];
  </code></pre>
  
  <p>P.S, I do not know about the <code>NSData</code> part, but it seems to work when I use that NSData line to send hex messages to the host. So I am leaving it as it is. Currently, <code>dataSmall[]</code> is hard coded and I would like to find out how to deal with it dynamically. Would appreciate all helps here.</p>
  
  <p><strong>EDIT 1</strong>
  Ah, I missed out an important information. The hex data is an <code>ISO8583</code> message itself. </p>