Passer des données à la fenêtre detravail lorsque l'annotation tapé sur mapview

J'ai une vue de la carte et il y a 10 magasins qui des données via un webservice. Je veux juste pousser mon détail pour afficher l'adresse, le téléphone et d'autres informations de l'cliqué magasin.

J'ai besoin de passer des données à mon detailview lorsque l'utilisateur a tapé ou faire des retouches à l'intérieur d'une annotation sur mapkit. Il y a 10 annotations dans mon mapview et d'abord, je veux savoir, comment puis-je comprendre ou comment puis-je obtenir le annotationID dont l'annotation est cliqué?

c'est la méthode que j'ai repères de retour

 - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{

    if ([annotation isKindOfClass:[MKUserLocation class]]) return nil;

    static NSString* AnnotationIdentifier = @"AnnotationIdentifier";

    MKPinAnnotationView* pinView = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:AnnotationIdentifier];

     pinView.animatesDrop=YES;
     pinView.canShowCallout=YES;
     pinView.pinColor=MKPinAnnotationColorPurple;

     UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
     [rightButton setTitle:annotation.title forState:UIControlStateNormal];

     [rightButton addTarget:self
     action:@selector(showDetails:)
     forControlEvents:UIControlEventTouchUpInside];

     pinView.rightCalloutAccessoryView = rightButton;

    return pinView;
}
   /* and my action method for clicked or tapped annotation: */

 - (IBAction)showDetails:(id)sender{

      NSLog(@"Annotation Click");

      [[mtMap selectedAnnotations]objectAtIndex:0];
      magazaDetayViewController *detail = [[magazaDetayViewController 
      alloc]initWithNibName:@"magazaDetayViewController" bundle:nil];

      detail.sehir=@"";
      detail.magazaAdi=@"";
      detail.adres=@"";
      detail.telefon=@"";
      detail.fax=@"";
      [self.navigationController pushViewController:detail animated:YES];

 }

si je peux obtenir sur lequel vous avez cliqué annotation index non, je peux remplir propriétés des détails avec mon tableau.
si cela est impossible, est-il un autre moyen de le faire?

OriginalL'auteur ercan | 2012-05-22