I'm trying to search through the addresses using MKLocalSearch, but it only comes up with business and not the exact address like e.g Maps (Apple's App).
I hope u guys can help me out - thanks! :)
MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = query;
request.region = self.mapView.region;
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
self.localSearch = [[MKLocalSearch alloc] initWithRequest:request];
[self.localSearch startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error){
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
if (error != nil) {
[[[UIAlertView alloc] initWithTitle:@"Map Error"
message:[error description]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] show];
return;
}
self.results = response;
`
In your results array, which is of type MKMapItem you need to configure the cells to give you the address when the tableView presents itself. Here's a quick example.
This is all done in your cellForRowAtIndexPath method that belongs to the UITableViewDataSource protocol.
Hope that helps, and best of luck to you!