title: Pass data to detailView when annotation tapped on mapview
body: <p>I have a map view and there are 10 store locations which data comes via webservice. I just want to push to my detail view to show address, telephone and other informations of the clicked store.</p>
  
  <p>I need to pass data to my <code>detailview</code> when user tapped or touch up inside to a annotation on mapkit. There are 10 annotations in my <code>mapview</code> and first I want to know, how can I understand or how can I get the annotationID of which annotation is clicked?</p>
  
  <p>this is the method I return pins</p>
  
  <pre><code> - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;)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];
  
   }
  </code></pre>
  
  <p>if i can just get the clicked annotation index no i can fill detail properties with my array.
  if this is impossible is there any other way to do it?</p>