Detecting value changed in UITextField

Total Post:10

 1207  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.

  1. Post:214

    Re: Detecting value changed in UITextField

    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.