Hi folks,
Found a bug in setting the text in textfields, in OF0073.
If you just use the normal setText method it just displays it temporarily (as if you’re still editing) and doesn’t save it.
You can check this by trying a getText immediately after the setText and you’ll see the getText returns null. getLabelText returns the setText value, but as soon as you close the textfield, that value is gone.
So, if you want your setText to store the value immediately upon setting, you need to do this:
In ofxiPhoneKeyboard.mm:
Old code:
- (void) setText: (NSString *)text
{
[_textField setText:text];
}
New code:
- (void) setText: (NSString *)text
{
[_textField setText:text];
[self textFieldDidEndEditing:_textField];
}
Hope that helps someone!