currently using apple's map view for iOS app when requesting a mklocalsearch request of type "restaurant" (to display nearby restaurants) all i am getting is the restaurants of the US when running on a device instead of getting nearby restaurants in current Location (Lebanon).
this is the code of my view did load the result prints on the log restaurants of america
_mapview.showsUserLocation=YES;
_mapview.delegate=self;
MKLocalSearchRequest *request =
[[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery=@"Restaurant";
request.region = _mapview.region;
MKLocalSearch *search =
[[MKLocalSearch alloc]initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse
*response, NSError *error) {
if (response.mapItems.count == 0)
NSLog(@"No Matches");
else
for (MKMapItem *item in response.mapItems)
{
NSLog(@"name = %@", item.name);
NSLog(@"Phone = %@", item.phoneNumber);
}
}];
figured it out! we must set the region of the map view manually or it will assume the region is in the US by default. this code is complete and will display nearby restaurants in your location
}