If i give any address for this method it is not at all calling.But if if give "1800 Ellis St,San Francisco, CA 94102,United States" it is being called. tell me what is wrong.
[geocoder geocodeAddressString:@"#83 2nd Floor Diagonal Road V.V.Puram Bangalore 560004 India"
completionHandler:^(NSArray* placemarks1, NSError* error){
for (CLPlacemark* aPlacemark in placemarks1)
{
annotationCoord= aPlacemark.location.coordinate;
[locationManager stopUpdatingLocation];
MKCoordinateRegion region;
region.center.latitude=annotationCoord.latitude;
region.center.longitude=annotationCoord.longitude;
region.span.longitudeDelta=0.;
region.span.latitudeDelta=0.;
self.mapView.showsUserLocation = YES;
[self.mapView setRegion:region];
_annotation=[[LDAnnotation alloc]initWithCoordinate:annotationCoord andTitle:@""subTitle:@""];
[self.mapView addAnnotation:(id<MKAnnotation>)_annotation];
[_searchAddressTF resignFirstResponder];
}
}];
your placemarks1 array is probably empty, as you're not checking if it is or not, the block just isn't executing. This is the common format
you can try printing the size of the place marks. Check out this page if you haven't seen it already. http://code.tutsplus.com/tutorials/forward-geocoding-with-clgeocoder--mobile-11011