title: MKAnnotationView - Lock custom annotation view to pin on location updates
body: <p><strong>Update #5</strong> I guess it's bounty time.  100+ views and no one's taken a stab, even with the code sample I've posted.  How about some reputation points!</p>
  
  <p><strong>Update #4</strong>This is a pretty complicated question, so I created a new tab based project which just includes the parts of my app I'm having trouble with here.  You can download it from: <a href="http://www.servinitup.net/CustomCalloutAnnotation.zip" rel="noreferrer">http://www.servinitup.net/CustomCalloutAnnotation.zip</a>
  Feel free to open it up (need to add your own bundle identifier to run it on your phone) and play around with it, and see if you can get that darned callout annotation to move with the pin!</p>
  
  <p><strong>Update #3</strong> Tried making setAnnotation a public method of the tutorial's CalloutMapAnnotationView and calling that directly.  Didn't have any luck.  Despite little oddities that occurred, the only thing that moved was the little triangle portion of the callout.  I could not get the entire callout to move.</p>
  
  <p><strong>Update #2</strong> Still not much luck, but have now been looking for ways to programmatically create a "pinch to zoom" and then undo it immediately, so the user never sees a change.  Hoping that doing this programmatically will have the same effect as doing it manually, and the callout annotation will pop back to it's parent.  Any ideas?</p>
  
  <p><strong>Update #1</strong> After playing around here's where I've gotten:
   - replaced <code>self.calloutAnnotation.coordinate = coords;</code> with <code>self.calloutAnnotation.latitude = coords.latitude;self.calloutAnnotation.longitude = coords.longitude;</code>
  - With that changed, if I slightly pinch the map to zoom in or out after the pin has been updated, the callout annotation animates to the correct position, right over the pin.  </p>
  
  <p>So now I need to figure out how to get this to happen without the user having to actually pinch to zoom.</p>
  
  <p><br />
  <strong>Original Post</strong></p>
  
  <p>I, along with other SO users, are using this awesome solution to create a custom callout annotation:
  <a href="http://blog.asolutions.com/2010/09/building-custom-map-annotation-callouts-part-1/" rel="noreferrer">http://blog.asolutions.com/2010/09/building-custom-map-annotation-callouts-part-1/</a></p>
  
  <p>When you use a standard callout (annotationview.canShowCallout = true) and the pin moves around the screen as the location is updated, the standard callout tracks right along with the pin, as if they're locked together.</p>
  
  <p>When using the custom callout solution above, when my pin moves around after location updates, the callout annotation stays in it's original location.  Of course, I'd like to mimic the iOS standard and have the custom callout annotation track along with the pin.</p>
  
  <p>Here's the code I have so far, that's successfully moving the annotation view, but not the custom callout annotation view:</p>
  
  <pre>
  /* core location broadcasts a notification, and my view controller listens to that notification and calls locationManagerDidFindLocation */
  - (void)locationManagerDidFindLocation:(NSNotification *)notif {
      CLLocation *location = [notif.userInfo objectForKey:@"location"];
      CLLocationCoordinate2D coords = [location coordinate];
      MKCoordinateSpan span = MKCoordinateSpanMake((5/69), (5/69));
      MKCoordinateRegion region = {coords, span};
  
      // if we don't have a current location yet, create one, place it on the map, and adjust the map's region
      // otherwise, update the annotation placement and map position in a smooth animation
      if (self.currentLocationAnnotation == nil) {
          self.currentLocationAnnotation = [[CurrentLocationAnnotation alloc] initWithCoordinate:coords andTitle:@"My Title" andSubtitle:@"My subtitle"];
  
          [self.mapView addAnnotation:self.currentLocationAnnotation];
          [self.mapView setRegion:region animated:true];
          [self.mapView regionThatFits:region];
      } else {
          [UIView beginAnimations:nil context:NULL];
          [UIView setAnimationDuration:0.45];
          [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
  
              // this moves my annotation view perfectly
              self.currentLocationAnnotation.coordinate = coords;
  
              // ******* this is where my problem is
              // ******* this custom callout annotation view stays
              // ******* in it's original place, even though it's
              // ******* parent annotation view is moving around the screen
              self.calloutAnnotation.coordinate = coords;
  
              [self.mapView setRegion:region animated:true];
              [self.mapView regionThatFits:region];
          [UIView commitAnimations];
      }
  }
  </pre>