I would like to detect a change in uitextfield and when ever there is a change in uitextfield then I would like to call a method so could anyone provide me some code showing how to do that.
thanks,
TC
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.
The UITextField calls this method on its delegate when a user has entered new text:
Here’s a reference to all the methods that a UITextField can call on its delegate.
You can return NO from the method if you don’t want to allow the change. You can set the delegate of you UITextControl like this:
It may already be setup in your xib file, though.
EDIT
To connect up your UITextField if you’re using InterfaceBuilder, right-click on the UITextField in the window and drag a line to the cube that represents your view controller (probably the third cube in the MyView.xib?) Then select delegate from the popup that appears.