zeigen Sie eine andere Ansicht als Karte, annotation angeklickt werden

Habe ich eine Karte mit nur einer Anmerkung.Habe ich eine einfache Klasse, die ich möchte es zu zeigen, wenn der Benutzer auf die Beschriftung.Das problem ist, dass wenn ich auf die Anmerkung, passiert nichts.

Hier ist mein code:

- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
    NSLog(@"Reverse Geocoder completed");
    mPlacemark=placemark;
    [mapView addAnnotation:placemark];
}

- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{
    MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"currentloc"];
    annView.animatesDrop=TRUE;

    //create UIButton for annotation
    UIButton *detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
    //NSInteger annotationValue = [self.annotations indexOfObject:annotation];

    [detailButton addTarget:self action:@selector(showDetailView:) forControlEvents:UIControlEventTouchUpInside];
    annView.rightCalloutAccessoryView=detailButton;
    return annView;
}


-(void)showDetailView:(id)sender{
    NSLog("inside the stupid method");
    MyDetailViewController *detailView=[[MyDetailViewController alloc] initWithNibName:@"MyDetailViewController" bundle:nil];
    [[self navigationController] pushViewController:detailView animated:YES];
    [detailView release];
}

Meine showDetailView - Funktion nie aufgerufen wird.Bitte helfen Sie mir.Ich bin neu in der iphone und ich könnte vergessen, eine einfache Sache.Dank

Immer noch nicht funktioniert!!!!

InformationsquelleAutor adrian | 2011-09-07
Schreibe einen Kommentar