0
我想將包含例如字符串「0d」的ObjectiveC NSString轉換爲十六進制值0x0d。什麼是最簡單的方法來實現呢?將表示HEX值的NSString轉換爲十六進制(@「0d」至0x0d)
實施例:
NSString *str = @"50";
unsigned char mac[1];
mac[0] = 0x50; //<- how to set mac[0] to 0x50 from "str" string?