I set maxlength in my textField, when I entered the maximum characters in the text box, backspace does not work. Because of this, I cannot change the contents of textFields. This happens when I test my application on iPhone sdk 3.0, but it works correctly on iPhone sdk 2.2.
Here is my code
- (BOOL)textField:(UITextField *)txtField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (txtField.text.length >= 15 && range.length == 0)
{
return NO;
}
else
{
return YES;
}
}
Why does this happen in iPhone sdk 3.0?
source
share