を使用してあなたの場所のすべての詳細を取得するにはCLGeocoder
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
[currentLocation stopUpdatingLocation];
CLLocation *myLocation = [[CLLocation alloc] initWithLatitude:latitudeValue longitude:longitudeValue];
CLGeocoder * geoCoder = [[CLGeocoder alloc] init];
[geoCoder reverseGeocodeLocation:myLocation completionHandler:^(NSArray *placemarks, NSError *error) {
if(!error)
{
for (CLPlacemark * placemark in placemarks)
{
NSLog(@"placemark.ISOcountryCode %@",placemark.ISOcountryCode);
NSLog(@"placemark.country %@",placemark.country);
NSLog(@"placemark.postalCode %@",placemark.postalCode);
NSLog(@"placemark.administrativeArea %@",placemark.administrativeArea);
NSLog(@"placemark.locality %@",placemark.locality);
NSLog(@"placemark.subLocality %@",placemark.subLocality);
NSLog(@"placemark.subThoroughfare %@",placemark.subThoroughfare);
}
}
else
{
NSLog(@"failed getting city: %@", [error description]);
}
}];
}