Moshe
Moshe

Reputation: 58097

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.

Upvotes: 1

Views: 446

Answers (1)

nacho4d
nacho4d

Reputation: 45118

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

Upvotes: 1

Related Questions