title: Set data for each bit in NSData iOS
body: <p>I created NSData of length 2 bytes (16 bits) and I want to set first 12 bits as binary value  of  (int)120 and 13th bit as 0 or 1(bit), 14th bit as 0 or 1 (bit) and 15th bit as 0 or 1(bit).</p>
  
  <pre><code>    This is what I want to do:
               0000 0111 1000 --&gt; 12 bits as 120 (int)
               1 &lt;-- 13th bit 
               0 &lt;-- 14th bit
               1 &lt;-- 15th bit
               1 &lt;-- 16th bit
  </code></pre>
  
  <p>Expected output  => <strong>0000 0111 1000 1011</strong> : final binary and convert it to NSData.</p>
  
  <p>How can I do that? Please give me some advice. Thanks all.</p>