Question

I am making a simple app that will allow the user to search for a location in a search bar and then the table view underneath will populate the results of the local search. When a user then clicks on a location from the table view it will annotate that location on the map.

I currently have a map setup that annotates the users current location. I have been searching around and I haven't really found anything that shows me how to do it in the specific way I am trying to do it. I have been getting confused as to how to go about this. Can anyone help me?

I am pretty new to iOS Development.

my map is called _mapView table view is called _resultsTable and my search bar is called _searchBar

Thanks guys!

Was it helpful?

Solution

So I figured it out!

I use the search bar methods below to run my local search:

-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{}

-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{}

I then store the results into an NSMutableArray and then run the reloadData method to update the table.

Hope it helps anyone who also had this problem!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top