1. 新生成一个MKReverseGeocoder
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate: newLocation.coordinate];
reverseGeocoder.delegate = self;
[reverseGeocoder start];
|
2. 失败代理中,设置delegate为nil。如果不设置nil则程序崩溃。
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
NSLog(@"%s %d, ", __FUNCTION__, __LINE__);
geocoder.delegate = nil;
if ([geocoder retainCount])
{
[geocoder autorelease];
}
}
|
阅读(3109) | 评论(0) | 转发(0) |