Can anyone tell me why this block of code isn’t being executed? I copied and pasted it from another project of mine, where it works just fine. I also tried it in my other app with the same addressString I’m plugging in here, and it worked perfectly. but it happens oly while passing string variable if I pass the address directly to geocodeaddressstring it works fine
NSString *addressString = @"2642 Broadway, New York, NY 10025, USA";
[forwardGeocoder1 geocodeAddressString:addressString
completionHandler:^(NSArray *placemarks, NSError *error){
// Make sure the geocoder did not produce an error
// before continuing
if(!error){
// Iterate through all of the placemarks returned
// and output them to the console
for(CLPlacemark *placemark in placemarks){
NSLog(@"found");
}
}
else{
// Our geocoder had an error, output a message
// to the console
NSLog(@"There was a forward geocoding error\n%@",
[error localizedDescription]);
}
}
];
error:
kCLErrorDomain error 8.
Please refer to this documentation
According to the documentation,
kCLErrorDomain error 8means:kCLErrorGeocodeFoundNoResult