nie calloutAccessoryControlTapped nazywa / wyzwalany

głosy
5

Użyłem tego przykładu w mojej aplikacji

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

ale jej nie dzwoni / wyzwalania calloutAccessoryControlTapped jak i stuknął accessorycontrol.

Oto mój kod.

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

Mam zmaga się z tym problemem na chwilę, wydaje się, że wiele osób ma ten sam problem, jak również. Każda pomoc będzie mile widziane. Dzięki

Utwórz 29/07/2009 o 01:47
źródło użytkownik
W innych językach...                            


1 odpowiedzi

głosy
0

Problem rozwiązany! Mój inny pogląd blokując MapView. [Self setUserInteractionEnabled NO];

Odpowiedział 29/07/2009 o 01:57
źródło użytkownik

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