title: MKAnnotationView's callout not refreshing properly
body: <p>I've got a problem with the accessory views in the <code>MKAnnotationView</code>s, but it only occurs when using the iOS 3 SDK. The 3.1.3 version specifically.</p>
  
  <p>I have a subclass of <code>MKAnnotationView</code> and I create instances of it the usual way:</p>
  
  <pre><code>SourceAnnotationView *annotationView = (SourceAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:kDefaultSourceAnnotationID];
  
  if (annotationView == nil) {
      #if DEBUG
          NSLog(@"RecordViewController viewForAnnotation source %d",[sourceAnnotation.ioiIdent intValue]);
      #endif
  
      annotationView = [[[SourceAnnotationView alloc] initWithAnnotation:sourceAnnotation reuseIdentifier:kDefaultSourceAnnotationID] autorelease];
      annotationView.delegate = self;
  }
  </code></pre>
  
  <p>Later on in the code, I change the content of the callout bubble by doing:</p>
  
  <pre><code>UIButton *deleteButton = [UIButton buttonWithType:UIButtonTypeCustom];
  [deleteButton setImage:[UIImage imageNamed:kDeleteAudioButtonImageName] forState:UIControlStateNormal];
  deleteButton.frame = CGRectMake(0, 0, kAnnotationViewLeftAccessoryWidth, kAnnotationViewLeftAccessoryHeight);
  deleteButton.tag = kDeleteAudioButtonTag;
  deleteButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
  deleteButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
  [deleteButton addTarget:self action:@selector(calloutButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
  
  selectedAnnotationView.leftCalloutAccessoryView = deleteButton;
  
  UIButton *editAudioInfoButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
  editAudioInfoButton.frame = CGRectMake(0, 0, kAnnotationViewRightAccessoryWidth, kAnnotationViewRightAccessoryHeight);
  editAudioInfoButton.tag = kEditInfoButtonTag;
  editAudioInfoButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
  editAudioInfoButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
  [editAudioInfoButton addTarget:self action:@selector(calloutButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
  
  selectedAnnotationView.rightCalloutAccessoryView = editAudioInfoButton;
  </code></pre>
  
  <p>with <code>kAnnotationViewRightAccessoryWidth</code> and <code>kAnnotationViewRightAccessoryHeight</code> being both equal to 32.</p>
  
  <p>When I no longer need these buttons, I try (and in most cases manage) to get rid of them like this:</p>
  
  <pre><code>selectedAnnotationView.rightCalloutAccessoryView = nil;
  selectedAnnotationView.leftCalloutAccessoryView = nil;
  </code></pre>
  
  <p>In iOS 4, this results in the accessory views dissapearing and everything working beautifully. However, in iOS 3 the two buttons stay, even though they're not clickable, as if they were not completely removed from the callout's view.</p>
  
  <p>Also, if I click any other annotation view the two buttons appear.</p>
  
  <p>Does anyone know how to solve this?</p>
  
  <p>Thanks!</p>
  
  <p>EDIT:</p>
  
  <p>Here is a picture of what happens:</p>
  
  <p><img src="https://i.stack.imgur.com/l9dat.jpg" alt="enter image description here"></p>