title: NSString to NSData conversion to Hex Value
body: <p>I've been trying to convert a user defaults NSString (tried NSData also), into a hex value I can use with char array. the problem is that every time I convert it from the NSString or NSData it takes the hex values and turns them into ASCII values, which isn't what I want at all. how to I tell it to literally take the values that are there and keep them hex? I'm struggling to find a solution.</p>
  
  <p>inside my .plist </p>
  
  <pre><code>&lt;key&gt;shit&lt;/key&gt;
  &lt;string&gt;5448495344414e475448494e474e45454453544f53544159484558&lt;/string&gt;
  </code></pre>
  
  <p>my code to convert the NSString to NSData</p>
  
  <pre><code>  NSString *defaults = [[NSUserDefaults standardUserDefaults] objectForKey:@"shit"];
      NSData *theData = [defaults dataUsingEncoding:NSUTF8StringEncoding];
      NSUInteger dataLength = [theData length];
      Byte *byteData = (Byte*)malloc(dataLength);
      memcpy(byteData, [theData bytes], len);
  
  NSLog(@"THIS : %@",[NSData dataWithBytes:byteData length:len]);
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>THIS : &lt;35343438 34393533 34343431 34653437 35343438 34393465 34373465 34353435 34343533 35343466 35333534 34&gt;len
  </code></pre>
  
  <p>why in the world is it doing this? I want the original hex values, not interpretation of my hex values. </p>