Reverse geocode challenge


I’m having big problems with this and have only got it working having copied the solution from gc3182 at viewtopic.php?f=80&t=2740#p5144

I’m don’t fully understand why it is now working nor why it was done in that way, delighted though I am to see it working.

Where do the properties “locality” and “administrativeArea” come from?

I’ve search for “administrativeArea” in the documentation and it took me to the MKPlacemark Class Reference page. There’s only one property listed on that page (“countryCode”) and there is no mention of administrativeArea in the text on the page at all which is confusing.

I can’t work out how I was supposed to know about those properties. Any suggestions?

I’m also completely stumped about what the following code does:

MKMapPoint originalPoint = MKMapPointForCoordinate( [geocoder coordinate] );
for( MapPoint * point in [worldView annotations] ) {
if( ![point isKindOfClass: [MapPoint class]] ) {
MKMapPoint annotationPoint = MKMapPointForCoordinate( [point coordinate] );
if( MKMapPointEqualToPoint( originalPoint, annotationPoint )) {
[point addPlacemarkToAnnotation: placemark];

If anyone can pick that apart and explain it to me I’d be very grateful, especially if you assume you’re talking to an idiot while you do it.

Many thanks.