Continual crashing in MKMapView annotationContainer:viewForAnnotation

Posted by Oscar Goldman on Stack Overflow See other posts from Stack Overflow or by Oscar Goldman
Published on 2011-11-16T01:47:21Z Indexed on 2011/11/16 1:50 UTC
Read the original article Hit count: 401

Filed under:
|

I've looked at other reports on this, and none seems to apply. Our app is being crippled by frequent (but not reliably reproducible) crashes like this:

enter image description here

Reports of this turn up a lot on the Web, but many seem to go unsolved. I'm not doing anything crazy, just showing the user position and one marker on the map. I followed the examples I could find, and I've looked at the code for goofs but can't find any.

Here's how my MapView delegate handles viewForAnnotation:

enter image description here

The crash appears to be associated with a change in the user's location, but once the user-location marker is added, I don't mess with it. When I need to refresh the one other map marker, I skip the user marker when removing the other one:

enter image description here

The delegate is the controller for the whole screen, so it's not being deallocated; the crash occurs while the screen is up. Not that it matters, but the map display looks like this:

enter image description here

Any guesses or insight would be much appreciated! This is on iOS 5.0.1.

© Stack Overflow or respective owner

Related posts about crash

Related posts about mkmapview