开发者

Why is didFindPlacemark never hit?

开发者 https://www.devze.com 2023-01-05 08:34 出处:网络
I am struggling with getting my MKReverseGeocoder to actually finish. This is what I do: // reverse geocode the user location

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开发者_StackOverflow中文版 ideas?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号