calloutAccessoryControlTapped nezavolal / spuštěno

hlasů
5

Použil jsem tento příklad v mé žádosti,

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

ale není volání / spouštění calloutAccessoryControlTapped jak jsem poklepal na accessorycontrol.

Tady je můj kód.

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

Byl jsem potýkají s tímto problémem na chvíli, zdá se, jako mnoho lidí má stejný problém stejně. Jakýkoliv pomoci chtěl bych být ocenil. dík

Položena 29/07/2009 v 01:47
zdroj uživatelem
V jiných jazycích...                            


1 odpovědí

hlasů
0

Problém je vyřešen! Můj druhý pohled byl blokuje MapView. [Vlastní setUserInteractionEnabled: NE];

Odpovězeno 29/07/2009 v 01:57
zdroj uživatelem

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