2009-07-29 3 views
5
내 응용 프로그램에서이 예제를 사용했다

,calloutAccessoryControlTapped은/

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

하지만 내가 accessorycontrol를 탭으로 calloutAccessoryControlTapped을 트리거/호출되지 트리거.

여기 내 코드입니다. 나는 잠시 동안이 문제로 어려움을 겪고있다

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

, 많은 사람들이뿐만 아니라 같은 문제가있는 것 같다. 도움이 될 것입니다. 감사합니다

답변

0

문제가 해결되었습니다! 내 다른보기가지도보기를 차단하고 있습니다. [self setUserInteractionEnabled : NO];