Reputation: 1103
I am trying to add a search bar and search display to a map view. I don't actually care how to handle the search request, my current problem is how to add a search bar and search display controller to a map view and how to set it up. I could't find any up to date documentation about this topic.
Upvotes: 0
Views: 2037
Reputation: 27072
//Add and bind Searchbar Controller to your viewcontroller
- (void) viewDidLoad
{
//Don't forget to add <UISearchBarDelegate> into your .h file
yourSearchbar.delegate=self;
}
//implement search bar delegate
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
{
NSLog(@"%@",searchBar.text);
//next you've to setup logic to pass search text to your mapview
}
Upvotes: 1