title: Decimal to Binary conversion method Objective-C
body: <p>Hi I am trying to make a Decimal to binary number converter in Objective-C but have been unsucessful... I have the following method so far which is an attempted translation from Java for a similar method. Any help to make this method work is much appreciated.</p>
  
  <pre><code> +(NSString *) DecToBinary: (int) decInt
  {
      int result = 0;
      int multiplier;
      int base = 2;
      while(decInt &gt; 0)
      {
          int r = decInt % 2;
          decInt = decInt / base;
          result = result + r * multiplier;
          multiplier = multiplier * 10;
      }
  return [NSString stringWithFormat:@"%d",result];
  </code></pre>