嗯,我有一個UITextField。 它內部是一個屬性UITextField.text。 它是確定的事情: // Assume we have UITextField * tf somewhere..
// now set its text..
tf.text = [ [ NSString alloc ] initWithUTF8String:"Init'd with utf8" ] ;
我可能在標準庫中缺少某些東西,但我不這麼認爲。我有這個當前的實現: int char2hex(unsigned char c) {
switch (c) {
case '0' ... '9':
return c - '0';
case 'a' ... 'f':
return c - 'a' + 10;
case 'A' ..