MapKit custom annotations being added to map, but are not visible on the map

Posted by culov on Stack Overflow See other posts from Stack Overflow or by culov
Published on 2010-06-09T08:37:58Z Indexed on 2010/06/09 8:52 UTC
Read the original article Hit count: 354

I learned a lot from the screencast at http://icodeblog.com/2009/12/21/introduction-to-mapkit-in-iphone-os-3-0/ , and ive been trying to incorporate the way he creates a custom annotation into my iphone app.

He is hardcoding annotations and adding them individually to the map, whereas i want to add them from my data source. So i have an array of objects with a lat and a lng (ive checked that the values are within range and ought to be appearing on the map) that i iterate through and do

[mapView addAnnotation:truck]

once this process is completed, i check the number of annotations on the map with [[mapView annotations] count] and its equal to the number it ought to be, so all the annotations are getting added onto the mapView, but for some reason I cant see any annotations in the simulator.

I've compared my code with his in all the pertinent places many times, but nothing seems to stand out as being incorrect. Ive also reviewed my code for the last several hours trying to find a point where I do something wrong, but nothing is coming to mind. The images are named just as they are assigned in the custom AnnotationView, the loadAnnotation function is done properly, etc... i dont know what it could be.

so i suppose if i could have the answer to one question it would be, what are possible causes for a mapView to contain several annotations, but to not show any on the map?

Thanks

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk