I have a variable nsdata
that is a byte array, and I want it as a string in string, but I don't want to decode it, I just want to have the same frame but in string.
nsdata = <024101e6 90eaf082 01e0df42 020002df 3d106967 e83efea5 c7bfe062 dca4737b 101bdf16 088c9877>
and I want to have it exactly the same but as a string:
nsstring = "<024101e6 90eaf082 01e0df42 020002df 3d106967 e83efea5 c7bfe062 dca4737b 101bdf16 088c9877>";
How could I do it?
Assuming it
nsdata
is of typeNSData *
, you can use:This would be the way, defining an encoding using NSString :