calloutAccessoryControlTapped ikke kalt / utløst

stemmer
5

Jeg har brukt dette eksempelet i søknaden min,

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

men det er ikke ringer / utløser calloutAccessoryControlTapped som jeg tappet accessorycontrol.

Her er min kode.

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

Jeg har slitt med dette problemet for en stund, virker som mange mennesker er å ha det samme problemet også. Eventuelle hjelpe ville være verdsatt. Takk

Publisert på 29/07/2009 klokken 00:47
kilden bruker
På andre språk...                            


1 svar

stemmer
0

Problem løst! Min andre syn ble blokkerer mapview. [Selv setUserInteractionEnabled: NO];

Svarte 29/07/2009 kl. 00:57
kilden bruker

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