I dont know i have mutable array ok mkannotation it is adding only one that too last one here is my code
code http://web.missouri.edu/~dnk6y2/Screen%20Shot%202012-11-12%20at%2011.46.05%20PM.png
I dont know i have mutable array ok mkannotation it is adding only one that too last one here is my code
code http://web.missouri.edu/~dnk6y2/Screen%20Shot%202012-11-12%20at%2011.46.05%20PM.png
You're adding kAnnotations
(bad name by the way. That style of name kName
is usually used for constants) to the contacts
array, then changing its values and adding it again. But it is still the same object. Every time you change kAnnotations
's coordinate and tile you're changing the one in the contacts
array too. You need to create a new kAnnotation each time like this
CustomAnnotation *customAnno = [[CustomAnnotation alloc] init;
customAnno.coorindate = coord;
customAnno.title = name;
[contacts addObject:customAnno];