Home > DeveloperSection > Forums > Detecting value changed in UITextField
Steven Hill
Steven Hill

Total Post:10

Posted on    October-28-2015 1:48 AM

 iPhone iPhone  Ios  Objective C 

 1 Reply(s)
 806  View(s)
Rate this:

I was creating an iPhone app and having a situation when I need to detect if the text field value is changed every time. The UITextFieldDelegate method shouldChangeCharactersInRange works but it’s not fully useful for me because it returns YES, so the texts of textField are not being available to other methods.

I want something like Java textChanged event handler, can anyone help me.

Tarun Kumar

Total Post:214

Posted on    October-28-2015 2:00 AM

Yes, your problem is thinkable but I have a solution for your problem. For the text field control add a notificationMethod “textFieldDidChange”.
For example:

[textField addTarget:self

Now, the textFieldDidChange: method will be called whenever you will change any value and also it can reload your table view as needed.

Don't want to miss updates? Please click the below button!

Follow MindStick