MKlocalSearch completion handler never called

363 views Asked by At

I am trying to use Apple's built in location search API (as opposed to Google's as it is free. Below is my code. My problem is that the completion handler for startWithCompletionHandler: never gets called. No exceptions are getting thrown either. What am I doing wrong here? Any help would be greatly appreciated.

MKLocalSearchRequest *searchRequest = [[MKLocalSearchRequest alloc] init];
searchRequest.naturalLanguageQuery = searchText;
searchRequest.region = self.mapView.region;

MKLocalSearch *search = [[MKLocalSearch alloc] initWithRequest:searchRequest];
[search startWithCompletionHandler:^(MKLocalSearchResponse *response, NSError *error) {
    [searchResults addObjectsFromArray:response.mapItems];
    [self.searchResultsTableView setSearchResults:searchResults];
}];
0

There are 0 answers