开发者

Responding to custom key presses on the iPad?

开发者 https://www.devze.com 2023-01-13 01:20 出处:网络
How do I add a character to a UITextField from ASCII or Unicode character set when a custom key is pressed?

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

精彩评论

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