tags:

views:

66

answers:

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)];
+5  A: 

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)];
Zoran Simic
thank you works fine :)
Mc.Lover