开发者

Why is didFindPlacemark never hit?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜