tags:

views:

41

answers:

0
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation
{
    MKPinAnnotationView *annView = nil;
    annView=[[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"]autorelease];
    for(int i=0;i<[List count];i++)
    {
        Small *Obj=[List objectAtIndex:i];
        if([[annView.annotation title] isEqualToString:Obj.streetAddress])
        {
            annView.animatesDrop=TRUE;
            annView.canShowCallout = YES;
            annView.calloutOffset = CGPointMake(-5, 5);
            annView.rightCalloutAccessoryView=[UIButton buttonWithType:UIButtonTypeDetailDisclosure];
            [annView setPinColor:MKPinAnnotationColorGreen];

        }

    }

    return annView;
}