MKMapView的内存释放问题
by 伍雪颖
- (void)dealloc { self.mapView.showsUserLocation = NO; self.mapView.userTrackingMode = MKUserTrackingModeNone; [self.mapView.layer removeAllAnimations]; [self.mapView removeAnnotations:self.mapView.annotations]; [self.mapView removeOverlays:self.mapView.overlays]; [self.mapView removeFromSuperview]; self.mapView.delegate = nil; self.mapView = nil; }
尽管不能释放所有的内存,但也能释放一部分的内存.