最近项目要添加导航功能,用了高德导航SDK,很郁闷每次从地图界面返回前一页面都报错,弄了很久,最终从高德开发者论坛找到一解决方法,可以试一下。
在导航的ViewController的viewWillDisappear中调用如下方法,以清理地图:
- (void)clearMapView
{
mapView.showsUserLocation = NO;
[mapView removeAnnotations:self.mapView.annotations];
[mapView removeOverlays:self.mapView.overlays];
mapView.delegate = nil;
}