title: How to remove previous Annotation pin when adding another one?
body: <p>I have a UITableView and each cell contains a Map button. When I tap each button, Map view is shown and corresponding Annotation pin is added.</p>
  
  <p>This code is called when I tap each map button, </p>
  
  <pre><code>    double tempLatitude  = [[[myDict objectForKey:key] objectAtIndex:15] doubleValue];
      double tempLongitude = [[[myDict objectForKey:key] objectAtIndex:16] doubleValue];
                                                    // key is the cell index.
  
           //--** Setting the Latitude and Longitude 
           CLLocationCoordinate2D myCoordinate;
  
           myCoordinate.latitude  = tempLatitude;
           myCoordinate.longitude = tempLongitude;
  
           MyMapAnnotation *MyAnnotation = [[[MyMapAnnotation alloc] initWithCoordinate:myCoordinate addressDictionary:nil]autorelease];
           MyAnnotation.title            = [[myDict objectForKey:key] objectAtIndex:1];
           MyAnnotation.subtitle         = [NSString  stringWithFormat:@"%f %f", MyAnnotation.coordinate.latitude, MyAnnotation.coordinate.longitude];
  </code></pre>
  
  <p>And  this is the code of MyMapAnnotation,</p>
  
  <pre><code>    @synthesize coordinate = theCoordinate;
      @synthesize title = theTitleAnnotation;
      @synthesize subtitle = theSubTitleAnnotation;
  
  
  
      - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate addressDictionary:(NSDictionary *)addressDictionary 
      {
  
        if ((self = [super initWithCoordinate:coordinate addressDictionary:addressDictionary]))
        {
           self.coordinate = coordinate;
        }
           return self;
      }
  </code></pre>
  
  <p>Everything   works fine. Now, when I tap one button, corresponding annotation pin is shown and when I tap second button, the previous pin is still there and second annotation pin is also being added. </p>
  
  <p>But </p>
  
  <p><strong>What I want is,</strong> </p>
  
  <p><strong>When I tap each button, the previous annotation pin should be removed and only the current annotation pin should be added</strong>.</p>
  
  <p><strong>How can I identify the previous pin?</strong> </p>
  
  <p><strong>And where can I give this code <code>[mapView removeAnnotation:annotationToRemove]</code> ??</strong></p>
  
  <p>EDIT: Obviously, the 'previous annotation pin' is the  'annotationToRemove'. I know this. <strong>My question is,   How can I identify this previous annotation pin to specify as 'annotationToRemove'??</strong></p>
  
  <p>Thanks :-)</p>