Search code examples
iphonemkmapviewmkannotationviewmapkit

MapView annotation View without Clicking


In my application show Multiple Annotation between two city but when we move one Annotation to other (with map region set on next previous Button) how to show Annotation detail automatic without clicking on it???


Solution

  • you can test with the title of the annotation, if it mach, you can use

    selectAnnotation: animated:
    

    to show the Annotation ( you can subclass MKAnnotation and add an id for test instead title ):

    for (id<MKAnnotation> annotation in mapView.annotations) 
    {   
        if( [annotation.title isEqualToString:title]) [mapView selectAnnotation:annotation animated:YES];
     }