我正在尝试使用 MKLocalSearch 搜索地址,但它只提供业务而不是确切的地址,例如地图(Apple 的应用程序)。
我希望你们能帮助我-谢谢!:)
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;
`