There is a reason why this method doesn’t work?
-(void)textViewDidBeginEditing:(UITextView *)textView
{
textView.text = @"";
}
I just want that when I tap on UITextView, the text inside is canceled…
Thanks and have a nice day!
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.
REPLACE:
OK. Here is what you need to do. First, in your class add the protocol:
Then go into Interface Builder/Storyboard and Ctrl-drag from the
UITextViewto the source file and it will give you the option to create the event. Then add your code to the new method.ADD:
Another thing with your current implementation. First, correction in terms. You are working with a UITextField (not UITextView). To get your original impl working:
First, be sure you you have added the protocol to your class.
Second, in your
viewDidLoadmethod, add the following:Finally, your method sig needs to change to (“view” -> “field”):