I really use this code to get the full location:
@property (nonatomic,strong) CLPlacemark *placemark;
@property (strong) CLLocationManager *gps;
@property (strong) CLGeocoder *geocoder;
- (void)viewDidLoad
{
[super viewDidLoad];
gps = [[CLLocationManager alloc] init];
geocoder = [[CLGeocoder alloc] init];
gps.delegate = self;
gps.desiredAccuracy = kCLLocationAccuracyBest;
[gps startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
[geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) {
if (error == nil && [placemarks count] > 0) {
placemark = [placemarks lastObject];
aLabel.text = [NSString stringWithFormat:@"%@ %@\n%@ %@\n%@",
placemark.thoroughfare,
placemark.subThoroughfare,
placemark.postalCode,
placemark.locality,
placemark.country];
} else {
NSLog(@"%@", error.debugDescription);
}
}];
}
but you can get more if necessary using the other CLPlacemark properties:
From CLPlacemark.h:
@property (nonatomic, readonly) NSString *name;
@property (nonatomic, readonly) NSString *thoroughfare;
@property (nonatomic, readonly) NSString *subThoroughfare;
@property (nonatomic, readonly) NSString *locality;
@property (nonatomic, readonly) NSString *subLocality;
@property (nonatomic, readonly) NSString *administrativeArea;
@property (nonatomic, readonly) NSString *subAdministrativeArea;
@property (nonatomic, readonly) NSString *postalCode;
@property (nonatomic, readonly) NSString *ISOcountryCode;
@property (nonatomic, readonly) NSString *country;
@property (nonatomic, readonly) NSString *inlandWater;
@property (nonatomic, readonly) NSString *ocean;
@property (nonatomic, readonly) NSArray *areasOfInterest;
Drkey source
share