Add the itemid property to the itemid class.
When adding annotation, set the property before calling addAnnotation :
destinationAnnotation.itemid = i.itemid; [self.mapView addAnnotation: ...
In calloutAccessoryControlTapped , go into the annotation details as follows:
MapViewAnnotation *annotationTapped = (MapViewAnnotation *)view.annotation; NSLog(@"annotationTapped.itemid = %@", annotationTapped.itemid);
(If itemid is int , change %@ in NSLog to %d .)
source share