MKMapView memory issues in ios7 sdk

I have MKMapView in the view controller and when I start scaling it consumes a lot of memory and when I leave the view that contains MKMapView the memory is not freed (I use ARC in my application)

Edit

I read in some answers that I should put MKMapView in AppDelegate:

-(MKMapView*) mapView { if(_mapView == nil) { _mapView = [[MKMapView alloc] init]; } return _mapView; } 

and in viewWillDisappear of viewController which contains MKMapView put

 -(void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; XAppDelegate.mapView.delegate = nil; [XAppDelegate.mapView removeFromSuperview]; } 

but that did not solve my problem.

+6
source share
1 answer

A common drawback I saw is that MKOverlay maintains a strong link to MKOverlayView / MKOverlayRender and MKMapView . This causes a save loop because MKMapView contains a strong reference to instances of MKOverlay .

+1
source

All Articles