I currently have an app that when I place an annotation on a map, it shows the title and subtitle, with the subtitle showing the lat/long/radius information.
-(NSString *)title{
return @"Saved position";
}
- (NSString *)subtitle {
return [NSString stringWithFormat: @"Lat: %.4F, Lon: %.4F, Rad: %.1fm",
self.coordinate.latitude, self.coordinate.longitude, self.radius];
}
-(id)initWithCoordinate:(CLLocationCoordinate2D) coor{
self.coordinate=coor;
NSLog(@"%f,%f",coor.latitude,coor.longitude);
return self;
}
I would like to change the subtitle line so that it shows an address. I know this is reverse geocoding using CLGeocoder however, I’m not certain how to do this properly. I’ve looked at many examples online, and have looked at the apple dev site, but its a little overwhelming. Any help is truly appreciated to this novice programmer.
I have solve this and wanted to share how I did it:
RegionAnnotation.h
RegionAnnotation.m
I currently have the user do a long push to create an annotation on the map view. Now when the user selects the pin by pressing it, it shows the physical address instead of the longitude and latitude.
I hope this helps all others who have been searching for a way to do this.