Custom iPad keyboard backspace method last character crash
Posted
by
isaaclimdc
on Stack Overflow
See other posts from Stack Overflow
or by isaaclimdc
Published on 2010-12-26T23:50:15Z
Indexed on
2010/12/26
23:54 UTC
Read the original article
Hit count: 230
I'm making a custom UI iPad keyboard app, and I'm doing something similar to this post for the backspace method: custom backspace button crashes iPhone app
However, the app will always crash when I "backspace" for the last character in the UITextView. I know -substringToIndex
won't work for an empty string, but I tried using a temporary mutable string then using -deleteCharactersInRange
, and that crashed it too.
I'm guessing the crash is due to me manually setting the -selectedRange
property for the text view after deleting a character? But even if I do:
textView.selectedRange = NSMakeRange(0, 0);
the app will crash. Any ideas?
© Stack Overflow or respective owner