Skip to content

Instantly share code, notes, and snippets.

@neiraza
Created September 23, 2014 13:52
Show Gist options
  • Save neiraza/bd8528d374270d3bb5e6 to your computer and use it in GitHub Desktop.
Save neiraza/bd8528d374270d3bb5e6 to your computer and use it in GitHub Desktop.
位置情報から住所を検索する
- (void)reverseGeocoder:(CLLocation *)location {
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:location
completionHandler:^(NSArray* placemarks, NSError* error) {
for (CLPlacemark *placemark in placemarks) {
NSLog(@"addressDictionary : %@", [placemark.addressDictionary description]);
NSLog(@"name : %@", placemark.name);
NSLog(@"thoroughfare : %@", placemark.thoroughfare);
NSLog(@"subThoroughfare : %@", placemark.subThoroughfare);
NSLog(@"locality : %@", placemark.locality);
NSLog(@"subLocality : %@", placemark.subLocality);
NSLog(@"administrativeArea : %@", placemark.administrativeArea);
NSLog(@"subAdministrativeArea : %@", placemark.subAdministrativeArea);
NSLog(@"postalCode : %@", placemark.postalCode);
NSLog(@"ISOcountryCode : %@", placemark.ISOcountryCode);
NSLog(@"country : %@", placemark.country);
NSLog(@"inlandWater : %@", placemark.inlandWater);
NSLog(@"ocean : %@", placemark.ocean);
NSLog(@"areasOfInterest : %@", placemark.areasOfInterest);
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment