I have a custom keyboard and whenever I touch the backspace button for the first time my app crashes! How can I solve this problem?
My code:
myText.text = [myText.text substringToIndex:([myText.text length]-1)];
I have a custom keyboard and whenever I touch the backspace button for the first time my app crashes! How can I solve this problem?
My code:
myText.text = [myText.text substringToIndex:([myText.text length]-1)];
Test if the existing text has at least one character for you to trim out...
if ([myText.text length]>0) myText.text = [myText.text substringToIndex:([myText.text length]-1)];