1

我使用此代码使用反向地理位置获取用户的整个地址。有人可以建议我从中获取邮政编码或邮政编码的方法吗?

//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];

 }];
4

1 回答 1

0

使用谷歌地图将地理位置转换为邮编地址。

https://developers.google.com/maps/documentation/geocoding/

于 2012-12-20T22:51:04.293 回答