I am using CLGeocoder, CLLocation for reverseGeocodeLocation which is giving me wrong country and country code. I am using Jersey coordinates but it is giving me Country = "United Kingdom" CountryCode = GB
My code is -
CLGeocoder *geocoder = [CLGeocoder new];
CLLocation *newLocation = [[CLLocation alloc]initWithLatitude:49.184668
longitude:-2.104771];
[geocoder reverseGeocodeLocation:newLocation
completionHandler:^(NSArray *placemarks, NSError *error) {
if (error) {
NSLog(@"Geocode failed with error: %@", error);
return; // Request failed, log error
}
// Check if any placemarks were found
if (placemarks && placemarks.count > 0)
{
CLPlacemark *placemark = placemarks[0];
// Dictionary containing address information
NSDictionary *addressDictionary =
placemark.addressDictionary;
// Extract address information
NSLog(@"%@ ", addressDictionary);
}
}];
And I am getting response -
{
City = "St Helier";
Country = "United Kingdom";
CountryCode = GB;
FormattedAddressLines = (
"25\U201353 Halkett Pl",
"St Helier",
Jersey
);
Name = "25\U201353 Halkett Pl";
State = Jersey;
Street = "25\U201353 Halkett Pl";
SubAdministrativeArea = "St Helier";
SubThoroughfare = "25\U201353";
Thoroughfare = "Halkett Pl";
ZIP = JE2;
}
Do we have some updates on how can we get Country = "Jersey" & CountryCode = JE
Appreciate if any workaround is there.
My code is -
CLGeocoder *geocoder = [CLGeocoder new];
CLLocation *newLocation = [[CLLocation alloc]initWithLatitude:49.184668
longitude:-2.104771];
[geocoder reverseGeocodeLocation:newLocation
completionHandler:^(NSArray *placemarks, NSError *error) {
if (error) {
NSLog(@"Geocode failed with error: %@", error);
return; // Request failed, log error
}
// Check if any placemarks were found
if (placemarks && placemarks.count > 0)
{
CLPlacemark *placemark = placemarks[0];
// Dictionary containing address information
NSDictionary *addressDictionary =
placemark.addressDictionary;
// Extract address information
NSLog(@"%@ ", addressDictionary);
}
}];
And I am getting response -
{
City = "St Helier";
Country = "United Kingdom";
CountryCode = GB;
FormattedAddressLines = (
"25\U201353 Halkett Pl",
"St Helier",
Jersey
);
Name = "25\U201353 Halkett Pl";
State = Jersey;
Street = "25\U201353 Halkett Pl";
SubAdministrativeArea = "St Helier";
SubThoroughfare = "25\U201353";
Thoroughfare = "Halkett Pl";
ZIP = JE2;
}
Do we have some updates on how can we get Country = "Jersey" & CountryCode = JE
Appreciate if any workaround is there.