calloutAccessoryControlTapped no llamado / activado

votos
5

He usado este ejemplo en mi aplicación,

http://spitzkoff.com/craig/?p=81

pero no está llamando / activando el control de acceso de llamada llamado a medida que toco el control de accesorios.

Aquí está mi código.

- (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);
}

He estado luchando con este problema por un tiempo, parece que mucha gente está teniendo el mismo problema también. Cualquier ayuda sería apreciada. Gracias

Publicado el 29/07/2009 a las 01:47
fuente por usuario
En otros idiomas...                            


1 respuestas

votos
0

¡Problema resuelto! Mi otra vista estaba bloqueando la vista de mapa. [self setUserInteractionEnabled: NO];

Respondida el 29/07/2009 a las 01:57
fuente por usuario

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more