EDIT: changed the title. I didn\'t know it at the time but this is a duplicate of Why am I crashing after MKMapView is freed if I'm no longer using it?
This q
While it's true that the delegates for such classes should be explicitly set to nil
, doing it in dealloc
is already too late. You already lost your reference to the mapview during viewDidUnload
. You should do the self.mapView.delegate = nil
BEFORE viewDidUnload
(so probably viewWillDisappear
or viewDidDisappear
)
From my experience, only MKMapView
and UIWebView
behave this way.