не calloutAccessoryControlTapped называется / срабатывании

голоса
5

Я использовал этот пример в моем приложении,

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

Я боролся с этой проблемой на некоторое время, кажется, что много людей с той же проблемой, как хорошо. Любая помощь будет оценена. благодаря

Задан 29/07/2009 в 01:47
источник пользователем
На других языках...                            


1 ответов

голоса
0

Задача решена! Другой мой взгляд блокировал MapView. [Не само setUserInteractionEnabled: NO];

Ответил 29/07/2009 в 01:57
источник пользователем

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