Dev vs Dev: Convert Integer to Binary as NSString

I recently was working on a project where I wanted to display an integer value as a binary string in Objective-C. Once I wrote what I thought were two decent implementations, I was curious to see how another developer would approach the same problem.

I asked Nick Lockwood if he would be up for coding up something similar. Bear in mind very limited requirements were provided upfront. The solution could be C function, a method or a category, and the signature for calling was undefined.

Read on to see four unique variations of how to convert an integer value into a binary NSString object.

Continue reading