views:

219

answers:

1

I have a search bar that when the search button is hit it will call a web service. The results of the web service can be quite large.

What I want to do is disable the "Search" button until the length of the search phrase is at least 3 characters. This will help in narrowing down the search results.

And yes, I've looked at this post. I can't get it to work for me (3.1.3 SDK).

Is this possible? How would I do this?

A: 

You could always add a condition to your searchBarSearchButtonClicked method to check the length of the text in the searchBar. Though that will still show the Search button as enabled, just won't actually do anything even if it's clicked.

SaltyNuts