I have an NSData object that is being allocated with bytes that are representing unsigned integers from 0-255. What is the simplest way to convert these bytes to integers, or, if it is easier, to a string/NSString?
For instance, if I have bytes 0x00, 0x02, and 0x0A in my NSData object, then I would like to have either an integer array of {0,2,10} or the string/NSString "0210".
It seems that there are plenty of ways to turn NSData into ASCII NSStrings,UInt8 arrays, etc, but I cannot for the life of me figure out how to do this simple conversion in Swift.
Edit: Example Code of what I want:
var data:NSData
/*allocate NSData*/
var unsignedInts = [Int]()
/*Allocate each byte of data to an individual index of unsignedInts */
print(unsignedInts)
//should see {0, 1, 10} if bytes are 0x00, 0x01, and 0x0A