Why doesn't the postal code go to the address dictionary?

I am developing a geocoder based application. In my application, to get the current address of the user, I use the address dictionary dictionary method in the geocode delegation method, and then I was able to get all the details (street, city, state, county, country code and all) except the zip code. Why does the postal code not arrive? Now I work with iOS 4. Please help me.

my code

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark    *)placemark
 {  
      placemark = [[MKPlacemark alloc] initWithCoordinate:locationManager.location.coordinate addressDictionary:[placemark addressDictionary]];

      NSLog(@"Address Dictionary %@", [placemark addressDictionary]);

      NSDictionary * addressDict= [placemark addressDictionary];

      country = [addressDict objectForKey:@"Country"];

      postal = [addressDict objectForKey:@"PostalCode"];

      state = [addressDict objectForKey:@"State"];

      city = [addressDict objectForKey:@"City"];

 }

This is my current address, which is from the address dictionary.

Address Dictionary {
City = Madurai;
Country = India;
CountryCode = IN;
FormattedAddressLines =     (
    "Lady Doak College Rd, Chinna Chokkikulam, Chockikulam",
    "Madurai, Tamil Nadu",
    India
);
State = "Tamil Nadu";
Street = "Lady Doak College Rd";
SubAdministrativeArea = Madurai;
SubLocality = "Chinna Chokkikulam";
Thoroughfare = "Lady Doak College Rd";
}

there is no poastalCode in the above code. but I need a zip code. get a zip code, what do I want to do? please give a decision.

+3
source share
2

, , .

 placemark = [[MKPlacemark alloc] initWithCoordinate:locationManager.location.coordinate addressDictionary:[placemark addressDictionary]];
0

Source: https://habr.com/ru/post/1762823/


All Articles