iOS 10中的MKMapView内存泄漏

时间:2017-06-14 06:18:13

标签: swift mkmapview ios10

我已经在我的项目中集成了MKMapView,但是当我弹出那个控制器时,它无法释放内存。我在iOS 10中遇到了这个问题,我只在iOS 9中测试过它运行正常。

我尝试使用下面的代码释放内存,但它无效。

let overlays = self.mapView.overlays
self.mapView.removeOverlays(overlays)
self.mapView.mapType = MKMapType.standard
self.mapView.showsUserLocation = false        
self.mapView.removeAnnotations(self.containerView.mapView.annotations)
self.mapView.delegate = nil
self.mapView.removeFromSuperview()
self.mapView = nil

0 个答案:

没有答案
相关问题