Έχω χρησιμοποιήσει αυτό το παράδειγμα στην αίτησή μου,
http://spitzkoff.com/craig/?p=81
αλλά δεν είναι καλώντας / ενεργοποίηση του calloutAccessoryControlTapped όπως εγώ αξιοποιηθεί το accessorycontrol.
Εδώ είναι ο κωδικός μου.
- (void)viewDidLoad {
MapAnnotation *annotation = nil;
annotation = [[MapAnnotation alloc] initWithCoordinate:[[trackPointsArray objectAtIndex:trackPointsArray.count - 2] coordinate]];
[mapView addAnnotation:annotation];
[super viewDidLoad];
}
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
MKAnnotationView *annotationView = nil;
// start pin
static NSString *StartPinIdentifier = @StartPinIdentifier;
MKPinAnnotationView *startPin = [annotationView dequeueReusableCellWithIdentifier:StartPinIdentifier];
if (startPin == nil) {
startPin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:StartPinIdentifier] autorelease];
startPin.animatesDrop = YES;
startPin.pinColor = MKPinAnnotationColorGreen;
startPin.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
startPin.canShowCallout = YES;
startPin.enabled = YES;
UIImage *image = [UIImage imageNamed:@location.png];
UIImageView *imgView = [[UIImageView alloc] initWithImage:image];
startPin.leftCalloutAccessoryView = imgView;
}
annotationView = startPin;
return annotationView;
}
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
NSLog(@calloutAccessoryControlTapped);
}
Έχω αγωνίζονται με αυτό το πρόβλημα για μια στιγμή, φαίνεται σαν πολλοί άνθρωποι που έχουν το ίδιο πρόβλημα. Οποιαδήποτε βοήθεια θα εκτιμηθεί. Ευχαριστώ













