In my application i create a custom Numberpad .How can i delete whole contents of the textfield on continuos tap on the clear button. Any idea?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This was a fun one.
Basically what I did was write a method to pull the last character out of the textField’s text String.
I added another method to be fired on the Button’s touchDown event, which first calls the method to erase the last character and then starts a timer to start repeating. Because the delay before repeating (at least on the native keyboard) is longer than repeat delay, I use two timers. The first one’s repeat option is set to NO. it calls a method that starts a second timer that repeats to call the erase last character method repeatedly.
In addition to the touchDown event. We also register for the touchUpInside event. When fired it calls a method that invalidates the current timer.