ios - UItextfield shouldChangeCharactersInRange method backSpace not working -


i implement code backspace not working until press delete button in uitextfield want backspace delete.

- (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string  {      nscharacterset *mycharset = [nscharacterset charactersetwithcharactersinstring:_demo_str];     (int = 0; < [string length]; i++) {          unichar c = [string characteratindex:i];          if ([mycharset characterismember:c]) {             return yes;       }     }     return no;   } 

try code. working me

- (bool)textfield:(uitextfield *)textfield shouldchangecharactersinrange:(nsrange)range replacementstring:(nsstring *)string  {    nscharacterset *mycharset = [nscharacterset charactersetwithcharactersinstring:_demo_str];   (int = 0; < [string length]; i++) {      unichar c = [string characteratindex:i];      if ([mycharset characterismember:c]) {         return yes;      }      else      {          return no;      }   }    return yes; } 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -