- (IBAction)reverseGeocodeCurrentLocation
{
self.reverseGeocoder =
[[[MKReverseGeocoderalloc]initWithCoordinate:mapView.userLocation.location.coordinate]autorelease];
reverseGeocoder.delegate =self;
[reverseGeocoder start];
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
NSString *errorMessage = [error localizedDescription];
UIAlertView *alertView = [[UIAlertViewalloc]initWithTitle:@"Cannot obtain address."
message:errorMessage
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark
{
NSLog(@"reverse finished...");
NSLog(@"country:%@",placemark.country);
NSLog(@"countryCode:%@",placemark.countryCode);
NSLog(@"locality:%@",placemark.locality);
NSLog(@"subLocality:%@",placemark.subLocality);
NSLog(@"