Reputation: 121
I need my searchBar to display search results when searchbar's textfield becomes active. I use
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
call, but have no object to show UISearchResultsTableView at once. It shows only when entering fist letter in search textfield.
Upvotes: 1
Views: 93
Reputation: 598
Use this method:
- (void)textFieldDidBeginEditing:(UITextField *)textField;
It will be executed on touch the textfield .
Upvotes: 0
Reputation: 176
Logic of filtering out the search result should be added in
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
delegate method.
- (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar
can be used to refresh the array objects when you start editing the search bar.
Upvotes: 3