2009-07-29 14 views
5

मैं अपने आवेदन में इस उदाहरण का इस्तेमाल किया है,calloutAccessoryControlTapped नहीं बुलाया/

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

लेकिन इसकी बुला नहीं/calloutAccessoryControlTapped ट्रिगर के रूप में मैं accessorycontrol टैप शुरू हो गया।

मेरा कोड यहां है।

- (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

समस्या हल हो गई! मेरा दूसरा दृश्य नक्शादृश्य को अवरुद्ध कर रहा था। [स्वयं सेट यूज़र इंटरटेक्शन सक्षम: नहीं];

संबंधित मुद्दे