Saturday, January 4, 2014

How to identify a Chinese character iphone finished entering

posts by amwrdfedr edited 2010-10-19 09:23:53
Use UITextField receive characters. When to Chinese input, or other full-width characters, carriage return into the bottom of the "Stop the association" or "OK", I can not find the event click on it to receive timely refresh their character.
In addition, in what UITextField. Text and string links rule is, who can explain.
This is a character I want to receive input, the old forward to doing good. Trouble you.
Reply:
The landlord did not understand what it meant. . . Receive events inside and then delegate to do just fine. .
textchange need to register notificenter
Reply:
Do not understand is that on the iPhone yet?
Reply:
Besides detail, perhaps you can help!
Reply:
Thank you, recent outing. Just come back. I have solved this.
When Keyboard call, enter the Chinese may use shouldChangeCharactersInRange not receive the event. Then should textFieldDidChange to receive. As follows:
_message = [[NSMutableString alloc] initWithCapacity: 32];
[_message SetString: @ ""];

- (Void) textFieldDidChange: (UITextField *) textField {
[_message SetString: @ ""];
[_message AppendString: textField.text];
addName ((char *) [_message UTF8String]);
}


/ / Return NO to not change text
- (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange) range replacementString: (NSString *) string {
[_message AppendString: string];
addName ((char *) [_message UTF8String]);
return YES;
}

Which addName for their function interface. This is a C + + to write the receive port.

No comments:

Post a Comment