title: Pass parameter on selector of UIButton
body: <p>I have a <code>detailDisclousure</code> button on the callout of a <code>MKAnnotation</code>. When this button is pressed I need to call a method passing a parameter that identifies the <code>annotation</code> that called it. How could it be done?</p>
  
  <p>this is my viewForAnnotation:</p>
  
  <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id &lt;MKAnnotation&gt;)annotation
  {
  
  if ([annotation isKindOfClass:[Annotation class]])
  {
      static NSString* identifier = @"identifier";
  
      MKPinAnnotationView* pinView = (MKPinAnnotationView*)[mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
  
      if (pinView == nil) 
      {
          pinView = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier]autorelease];
      }
  
      Annotation *antt = annotation;
  
      pinView.canShowCallout = YES;
      pinView.draggable =    YES;
  
      UIButton* detailButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
  
      [detailButton performSelector:@selector(goToViewWithAnnotation:) withObject:antt];
  
      pinView.rightCalloutAccessoryView = detailButton;
  
      return pinView;
  }
  
  else 
  {
      return nil; 
  }
  }
  </code></pre>
  
  <p>And this is the method that should be called with the parameter:</p>
  
  <pre><code>-(void)goToViewWithAnnotation:(Annotation *)annotation
  {
      NextViewController *nextView = [[NextViewController alloc]initWithNibName:@"NextViewController" bundle:nil];
  
  nextView.id = annotation.id;
  
  [self.navigationController nextView animated:YES];
  }
  </code></pre>