Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to add multiple pin at the same lat/long
    text
    copied!<p>I am trying to add multiple pin at the same location.</p> <pre><code>for (int i = 0; i &lt; [arrListing count]; i++) { List *obj = [arrListing objectAtIndex:i]; NSLog(@"Title %@",obj.Title); CLLocationCoordinate2D annotationCoord; annotationCoord.latitude = [obj.lat floatValue]; annotationCoord.longitude = [obj.log floatValue]; MKPointAnnotation *annotationPoint = [[MKPointAnnotation alloc] init]; annotationPoint.coordinate = annotationCoord; annotationPoint.title = obj.Title; [mapView addAnnotation:annotationPoint]; } </code></pre> <p>the above code represent adding mulitiple annotation but many pin are at the same location</p> <p><strong>So I can see only. last and the second last at that point.</strong> below is the code for the viewForAnnotation </p> <pre><code>- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;) annotation{ MKPinAnnotationView *annView = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:@"annView"]; if (!annView) { annView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"annView"]; annView.pinColor = MKPinAnnotationColorRed; annView.animatesDrop = YES; annView.canShowCallout = YES; NSLog(@"iRow :%d",iRow); annView.tag = iRow++; UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; annView.rightCalloutAccessoryView = rightButton; NSLog(@"if condition"); } else { annView.annotation = annotation; NSLog(@"else condition"); } return annView; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload