views:

102

answers:

1

I am struggling with getting my MKReverseGeocoder to actually finish. This is what I do:

// reverse geocode the user location
geocoder = [[[MKReverseGeocoder alloc] initWithCoordinate:mapView.userLocation.location.coordinate] autorelease];
geocoder.delegate = self;
[geocoder start];

The userLocation coordinate IS valid, I know that. I have didFindPlacemark and didFailWithError, and neither of those are hit... Either I have the delegate set up wrong or I have no idea...Here's the header:

@interface E_85AppDelegate : UIViewController <UIApplicationDelegate, MKMapViewDelegate, MKReverseGeocoderDelegate, CLLocationManagerDelegate>
{   
    IBOutlet UIWindow *window;
    IBOutlet UITabBarController* tabBarController;
    IBOutlet MKMapView*   mapView;
    IBOutlet MKReverseGeocoder* geocoder;
        // other class members...
}

Any ideas?

A: 

Evidently my understanding of autorelease is not very good. It releases the geocoder before didFindPlacemark is ever sent the message.