I am currently working on an app that will use the data returned by reversegeocode. Right now I can successfully receive the following values for a location: address, city, state, zip code, and country. In addition to the values that I am able to get, I would also like to obtain the name of the neighborhood for the locations that I reversegeocode. My code is as follows:
CLLocationManager *location = [[CLLocation alloc] init];
[location setDelegate:self];
location.desiredAccuracy=kCLLocationAccuracyBest;
location.distanceFilter=kCLDistanceFilterNone;
[location startMonitoringSignificantLocationChanges];
CLGeocoder *geolocation = [[CLGeocoder alloc] init];
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
NSLog(@"Update method is definitely being called!");
NSLog(@"Your current location is : %@", [locations lastObject]);
[geolocation reverseGeocodeLocation:[locations lastObject] completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"Reverse geocode complete: %@", placemarks);
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"The locality area is: %@", placemark.locality);
}];
}
I expected placemark.locality to return the neighborhood but it returns the city instead.
Any help would be greatly appreciated,
Dave