Possible Duplicate:
How to search MKMapView with UISearchBar?
I have one UISearchBar with MKMapView with google maps. I need suggestions whenever i started typing. So what should i need to do for that ? Is there any web service for google api ?
Possible Duplicate:
How to search MKMapView with UISearchBar?
I have one UISearchBar with MKMapView with google maps. I need suggestions whenever i started typing. So what should i need to do for that ? Is there any web service for google api ?
Use CLGeocoder
to generate address results based on a string.
This is known as forward geocoding
.
You'll get a number of placemarks returned which you can populate into your UI.
Quick example here:
NSString *address = @"Big Ben";
CLGeocoder *coder = [[CLGeocoder alloc] init];
[coder geocodeAddressString:address completionHandler:^(NSArray *placemarks, NSError *error){
//Do something with the returned placemarks
}];
You can also restrict results to a set region if specific, that's all documented at the link above.
To see complete illustration go through this post.