calloutAccessoryControlTapped nicht genannt / ausgelöst

stimmen
5

Ich habe dieses Beispiel in meiner Anwendung verwendet wird,

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

aber es ist nicht Aufruf / Auslösung der calloutAccessoryControlTapped als ich die accessorycontrol angezapft.

Hier ist mein 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);
}

Ich habe mit diesem Problem für eine Weile zu kämpfen, scheint wie eine Menge Leute, auch das gleiche Problem hat. Jede Hilfe wäre sehr geschätzt. Vielen Dank

Veröffentlicht am 29/07/2009 um 01:47
quelle vom benutzer
In anderen Sprachen...                            


1 antworten

stimmen
0

Problem gelöst! Meine andere Ansicht wurde die Blockierung der mapview. [Self setUserInteractionEnabled: NO];

Beantwortet am 29/07/2009 um 01:57
quelle vom benutzer

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