首页 > 代码库 > MKMapView的内存释放问题

MKMapView的内存释放问题

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;
}

虽然不能释放全部的内存,但也能释放一部分的内存.


MKMapView的内存释放问题