此代码用于使用Reverse Geolocation获取用户的整个地址。有人可以建议我从中获取邮政编码或邮政编码。
//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];
}];
答案 0 :(得分:0)
使用Google地图将地理位置转换为zip地址。