문제 설명
MKMapview를 사용하는 동안 MB의 메모리 사용량이 발생하고 ARC를 사용하는 동안 View가 사라질 때 메모리가 해제되지 않습니다. (While using MKMapview causing MBs of memory usage and using ARC it not releasing memory when View Disappears)
Xcode 6.0 및 iOS 8.4를 사용하고 내가 시도한 것은 다음과 같습니다.
‑(void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
mapView.mapType = MKMapTypeHybrid;
mapView.mapType = MKMapTypeStandard;
mapView.showsUserLocation = NO;
mapView.delegate = nil;
[mapView removeFromSuperview];
mapView = nil;
}
ARC를 사용하고 있습니다. 보기가 사라질 때 메모리를 해제하지 않습니다.
참조 솔루션
방법 1:
Have you tired making MapView or the view controller to be a weak reference?
e.g.: If you're pushing to a view controller with a Map view. Assign it to a weak property.
<p>@property (weak,nonatomic) UIViewController *mapViewController;</p>
(by Ronak Chaniyara、rajeeva9)