Text Field Help

Discussion in 'iOS Programming' started by sjarman, Oct 24, 2008.

  1. sjarman macrumors newbie

    Joined:
    Sep 24, 2008
    Location:
    Sydney, Australia
    #1
    I've got a UITextField in my view and a UISearchBar.

    I need to figure out a way to make everything that the user types into the TextField automatically appear in the SearchBar, as the user types it.

    In other words, I want the SearchBar to mirror the text in the TextField letter by letter.

    Anyone have any suggestions?
     
  2. Niiro13 macrumors 68000

    Joined:
    Feb 12, 2008
    Location:
    Illinois
    #2
    textField:shouldChangeCharactersInRange:replacementString:

    It's a UITextFieldDelegate method.

    Note that the replacement string isn't the string for the whole text rather just the character (so "searc" the replacement string would be "h" if someone types that...).
     
  3. sjarman thread starter macrumors newbie

    Joined:
    Sep 24, 2008
    Location:
    Sydney, Australia

Share This Page