char - Cannot delete text in UITextField -


i have implemented max character limit on uitextfield. problem when input max number characters, unable backspace characters. can tell me doing wrong? below code:

-(bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string {

if (textfield == pincode) {     if ([textfield.text length]<=3) {         return yes;             }     else {         return no;     } } else {     return yes; } return yes; 

}

change condition to:

if ([textfield.text length]<=3 || string.length == 0) {     ... 

if content of string control character f.e. backspace, length zero


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -