¡@

Home 

2014/10/15 ¤U¤È 10:11:19

iphone Programming Glossary: mapviewannotation

Annotation on the map problem

http://stackoverflow.com/questions/6410798/annotation-on-the-map-problem

2.0 location.latitude 43.25f location.longitude 11.00f region.span span region.center location addAnnotation MapViewAnnotation alloc initWithLocation location withTitle NSString stringWithFormat @ Tuscany withSubTitle NSString stringWithFormat @ Italy.. return annView And here last Supportive Class .h #import Foundation Foundation.h #import MapKit MapKit.h @interface MapViewAnnotation NSObject MKAnnotation CLLocationCoordinate2D coordinate NSString mTitle NSString mSubTitle @property nonatomic retain NSString.. UIImage locationImage CLLocationCoordinate2D initWithLocation CLLocationCoordinate2D location @end .m #import MapViewAnnotation.h @implementation MapViewAnnotation @synthesize coordinate @synthesize mTitle mSubTitle id initWithLocation CLLocationCoordinate2D..

pass id to calloutAccessoryControlTapped

http://stackoverflow.com/questions/7449172/pass-id-to-calloutaccessorycontroltapped

destination destination.latitude double i.latitude destination.longitude double i.longitude i.itemid MapViewAnnotation destinationAnnotation MapViewAnnotation alloc initWithTitle i.name andCoordinate destination self.mapView addAnnotation.. double i.latitude destination.longitude double i.longitude i.itemid MapViewAnnotation destinationAnnotation MapViewAnnotation alloc initWithTitle i.name andCoordinate destination self.mapView addAnnotation destinationAnnotation destinationAnnotation.. details here. NSLog @ @ control iphone mkmapview share improve this question Add an itemid property to the MapViewAnnotation class. When adding the annotation set the property before calling addAnnotation destinationAnnotation.itemid i.itemid self.mapView..