Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to know which annoation has been tapped?
    text
    copied!<p>I am doing mapview. In my app there is code which gets current location of the user in latitude and longitude. Using this coordinates i am creating a soap request. In response i will get information(zip,city,state,country,coordinates) of locations. I have saved this information in NSDictionary.</p> <p>This is the code for creating annotation.</p> <pre><code>MapLocation *annotation = [[MapLocation alloc] initWithCoordinate:location ownerInst:ownerInstitution]; [mapView addAnnotation:annotation]; [annotation release]; - (MKAnnotationView *) mapView:(MKMapView *)theMapView viewForAnnotation:(id &lt;MKAnnotation&gt;) annotation { MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"]; annView.pinColor = MKPinAnnotationColorGreen; annView.animatesDrop=TRUE; annView.canShowCallout = YES; UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [infoButton addTarget:self action:@selector(infoButtonPressed) forControlEvents:UIControlEventTouchUpInside]; annView.rightCalloutAccessoryView = infoButton; annView.calloutOffset = CGPointMake(-5, 5); return annView; } </code></pre> <p>This is the delegate method when user tap the detaildisclosurebutton in the callout.</p> <pre><code>- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control </code></pre> <p>On the tap of detail disclosure button new view will be loaded. And in this new view, information which i retrieved from the server will be displayed.</p> <p>Upto this everything is fine. I have more than one annotations in the map. But when particular annotation is tapped how will i implement the code to show the information (which i get from the server)related to that annotation.</p> <p>I hope I am clear in expressing my problem. Feel free to ask further details.</p>
 

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