Hey, one part of my applikation covers an MkMapview. Therefore i load a list of geocode information from my server and place each tuple as a MkAnnotation pin on my map. After being placed each MkAnnotation object will be released. Now i want to search for a specific MkAnnotation already being placed on my map and if available popup the addtional information bubble.How do i achieve that? Thanks.
+3
A:
There is a property on your MKMapView (from the apple docs):
@property (nonatomic, readonly) NSArray *annotations
It returns an array of annotations and you can search the array for what you need.
Hope this helps!
EDIT:
Also, I just saw that you want to programmatically select an annotation... if you take a look at the selectedAnnotations property on the MKMapView class it says:
Assigning a new array to this property selects the first annotation in the array only.
So you could pass in an Array with your annotation you want selected... I've never tried it but it would seem that it should work based on what the docs say.
Ryan Ferretti
2010-03-06 13:10:43
Thanks that solved the problem
Simon D.
2010-03-06 23:05:23
Glad to help!!!
Ryan Ferretti
2010-03-06 23:36:54