title: How to keep data associated with MKAnnotation from being lost after a callout pops up and user taps disclosure button?
body: <p>How do I keep data associated with an MKAnnotation object after the user taps the pin, sees a callout, and taps the disclosure button which opens a detailed view controller? I want to display all data associated with the pin in the detail view controller.  </p>
  
  <p>I have a simple MKAnnotation class that looks like:</p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  #import &lt;MapKit/MapKit.h&gt;
  @interface VoiceMemoryAnnotation : NSObject &lt;MKAnnotation&gt; {
      NSString * blobkey;
  }
  @property (nonatomic, retain) NSString * blobkey;
  
  -(id)initWithBlobkey:(NSString *) key andCoordinate:(CLLocationCoordinate2D) c;
  @end
  </code></pre>
  
  <p>I implemented the call back "viewForAnnotation"</p>
  
  <pre><code>- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id     &lt;MKAnnotation&gt;)annotation
  {
      MKPinAnnotationView*singleAnnotationView = [[MKPinAnnotationView alloc]initWithAnnotation:annotation reuseIdentifier:nil];
  
  
  // PM: this pin will have a callout (i.e. dont' forget to override title function! Else exception thrown)
      singleAnnotationView.canShowCallout = YES;
  
  // PM: add disclosure button
      UIButton* rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
  
  // PM: when user taps disclosure button, bring them to another page with details about the selected voice memory
         [rightButton addTarget:self action:@selector(showPinDetails:) forControlEvents:UIControlEventTouchUpInside];
      singleAnnotationView.rightCalloutAccessoryView = rightButton;
  
      return singleAnnotationView;
  }
  </code></pre>
  
  <p>If I understand correctly, the above method is called when you add a VoiceMemoryAnnotation to a map object.  When this viewForAnnotation is called, I simply allocate a MKPinAnnotationView object and return it.  When the user taps this retuned pin, they see the callout.  As soon as they click the disclosure button it  calls "showPinDetails":</p>
  
  <pre><code>- (void)showPinDetails:(id)sender
  {
  
  
      detailViewController = [[MemoryDetailViewController alloc]initWithNibName:@"MemoryDetailViewController" bundle:nil];
      [self presentModalViewController:detailViewController animated:YES];
  
  }
  </code></pre>
  
  <p>The problem is the "sender" object does not contain any information about which pin was selected.  Is there some way I can pass in the selected annotation to the showPinDetails method?</p>