Tego kodu używam, aby uzyskać cały adres użytkownika korzystającego z odwrotnej geolokalizacji. Czy ktoś może zasugerować mi sposób, aby po prostu wyciągnąć z niego kod pocztowy lub kod pocztowy.
//Geocoding Block
[self.geoCoder reverseGeocodeLocation: locationManager.location completionHandler:
^(NSArray *placemarks, NSError *error) {
//Get nearby address
CLPlacemark *placemark = [placemarks objectAtIndex:0];
//String to hold address
NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];
//Print the location to console
NSLog(@"I am currently at %@",locatedAt);
//Set the label text to current location
[locationLabel setText:locatedAt];
}];
Odpowiedzi:
0 dla odpowiedzi № 1Użyj map Google, aby przekonwertować lokalizację geograficzną na adres zip.
https://developers.google.com/maps/documentation/geocoding/