NSNumber to NSString of binary
Hi All,
I have a simple question that I seem to be tying myself up in knots over.
I'll answer the "why" first, as I'm sure it'll come up: I'm parsing NMEA data for an AIVDM message, which has 6bit binary encoded as ASCII gibberish. I need to reverse the process, then break down the bits into chunks to get things like ship name, bearing, speed, etc.
Now, having explained the why, here's the question:
Is there a Cocoa way to take an NSNumber and convert this to a string representing the binary digits, or should I stop trying to use straight Cocoa and just hack it in C?
I tried looking at NSNumberFormatter, but that didn't have the binary option, so is there another way?
Thanks,
Jase
|