Possible Duplicate:
NSString (hex) to bytes
I'm currently stuck trying to convert the contents of a NSString
to a byte.
My program receives a string, for example CC
to a byte 0xCC
I understand that you can convert an NSString
to its hex representation, but this isn't what I need, as that uses the string encoding -- my CC
would turn out as 0x63
.
From what I understand, I need to cast the NSString
(or char
) to a raw byte, so that I can then later on convert it to a decimal but i'm getting really confused on how to do it.