I have an app that calls addAnnotation
exactly 3 times (after verifying that the coordinates are good using CLLocationCoordinate2DIsValid
, passing a model that responds to id
, title
latitude
, longitude
and coordinate
. In the model, I watch the callbacks by doing an NSLog
in my coordinate
method.
Note that coordinate
and name
are implemented as methods, although this should make no difference, right?
What I expect:
MapKit will access the coordinate method 3 times
What I get:
MapKit access the coordinate 3 times per coordinate, then tries a 4th time, even though there is no 4th coordinate and the app crashes on a memory exception as the result is nil
.
I am pretty naive about MapKit, but there has to be some explanation for this that I'm missing.
Any help appreciated!