title: Convert NSData to signed integer
body: <p>I have seen some similiar questions but I can't get this right: </p>
  
  <p>I receive a 16 bit signed integer in an NSData object, e.g '0xFF3C'. How can I read out the correct number from this? </p>
  
  <p>EDIT: With James Webster's answer I get:</p>
  
  <pre><code>Received hex value : &lt;0800&gt;
  Converted value: 803995656
  Received hex value : &lt;0a00&gt;
  Converted value: 803995658
  Received hex value : &lt;1a00&gt;
  Converted value: 803995674
  Received hex value : &lt;faff&gt;
  Converted value: 804061178
  Received hex value : &lt;e4ff&gt;
  Converted value: 804061156
  Received hex value : &lt;f0ff&gt;
  Converted value: 804061168
  </code></pre>
  
  <p>which clearly is not correct (I expect +/- 2000)</p>
  
  <p>EDIT: Some code:</p>
  
  <pre><code>-(void)characteristicValueRead:(CBCharacteristic *)characteristic{
  
    unsigned short myInt = (int) [characteristic.value bytes];
    NSLog(@"Received value: %@", characteristic.value);
    NSLog(@"Converted value: %i",(int)myInt);
  }
  </code></pre>
  
  <p>With this snippet I get: </p>
  
  <pre><code>Received value: &lt;0000&gt;
  Converted value: 26176
  Received value: &lt;0000&gt;
  Converted value: 46688
  Received value: &lt;0000&gt;
  Converted value: 30576
  Received value: &lt;0000&gt;
  Converted value: 2656
  Received value: &lt;0000&gt;
  Converted value: 50896
  Received value: &lt;0000&gt;
  </code></pre>
  
  <p>which looks really interesting/annoying. What could this come from? </p>