title: hex a to binary
body: <p>i am trying to convert my hex value to binary value , but i am facing little problem .
  as i am new trying to learn my faults .</p>
  
  <p>my code :</p>
  
  <pre><code>NSMutableString *str;
  NSString *dd = @"192:168:1:2:0B:2:D:00";    
  NSCharacterSet *donotwant1 = [NSCharacterSet characterSetWithCharactersInString:@":""];
  dd =[[dd componentsSeparatedByCharactersInSet:donotwant1] componentsJoinedByString:@" "];
  NSMutableArray *array = [[dd componentsSeparatedByString:@" "] mutableCopy];
  
  [array removeObjectAtIndex:0];
  //NSLog(@"%@",array);
  
  for (int j=0; j&lt;[array count]; j++) {
      NSScanner *scan = [NSScanner scannerWithString:[array objectAtIndex:j]];
      unsigned int i=0;
  
      if ([scan scanHexInt:&amp;i]) {
          // NSLog(@"numbner is %ustr", i);
      }
  
      NSInteger theNumber = i;
      str = [NSMutableString string];
      for(NSInteger numberCopy = theNumber; numberCopy &gt; 0; numberCopy &gt;&gt;= 1) {
          // Prepend "0" or "1", depending on the bit
          [str insertString:((numberCopy &amp; 1) ? @"1" : @"0") atIndex:0];
  
          [array removeObjectAtIndex:j];
          [array  insertObject:str atIndex:j];
      }
  }
  
  NSLog(@"Binary version: %@", array);
  </code></pre>
  
  <p>I'm getting</p>
  
  <p>1,1100,11001111,1111,1111,11101111.....</p>
  
  <p>in my code 0 values are eliminated . i want 8bits like(00000001,00001100.....) can any one tell me the reason</p>