开发者

Responding to custom key presses on the iPad?

How do I add a character to a UITextField from ASCII or Unicode character set when a custom key is pressed?

Disclaimer: I've seen tons of questions here on Stack Overflow, but I haven't gotten all the information I need to make a hebrew开发者_运维百科 keyboard.


When your custom key (the simplest case:UIButton) is pressed you append a certain string to uitextfield.text property.

uitextfield.text = [uitextfield.text stringByAppendingString:@"yourAsciiString"];

the way you convert ascii to strings the same way you will do it in C then you convert that C string to NSString using:

- (id)initWithCString:(const char *)nullTerminatedCString encoding:(NSStringEncoding)encoding
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜