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

尽管不能释放所有的内存,但也能释放一部分的内存.


posted @ 2016-04-03 11:38  zfyouxi  阅读(374)  评论(0编辑  收藏  举报