calloutAccessoryControlTapped niet geroepen / getriggerd

stemmen
5

Ik heb dit voorbeeld gebruikt in mijn aanvraag,

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

maar het is niet te bellen / activeren van de calloutAccessoryControlTapped zoals ik tikte de accessorycontrol.

Hier is mijn code.

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

Ik heb moeite met dit probleem voor een tijdje, lijkt een heleboel mensen is het hebben van het zelfde probleem. Alle hulp zou worden gewaardeerd. Bedankt

De vraag is gesteld op 29/07/2009 om 01:47
bron van user
In andere talen...                            


1 antwoorden

stemmen
0

Probleem opgelost! Mijn andere opvatting werd het blokkeren van de MapView. [Zelf setUserInteractionEnabled: NEE];

antwoordde op 29/07/2009 om 01:57
bron van user

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