I downloaded the XCode project from the link you mentioned and was able to reproduce the error. The following answer has a workaround that worked for me
MKMapView Not Calling regionDidChangeAnimated on Pan
For convenience I want to repeat the solution and how I applied it in the mentioned project
In CustomCalloutViewController.h
add UIGestureRecognizerDelegate
@interface CustomCalloutViewController : UIViewController
<MKMapViewDelegate, UIGestureRecognizerDelegate>
In CustomCalloutViewController.m
in method viewDidLoad
add before [super viewDidLoad];
if (NSFoundationVersionNumber >= 678.58){
UIPinchGestureRecognizer *pinch = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchGestureCaptured:)];
pinch.delegate = self;
[mapView addGestureRecognizer:pinch];
[pinch release];
UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureCaptured:)];
pan.delegate = self;
[mapView addGestureRecognizer:pan];
[pan release];
}
Then still in CustomCalloutViewController.m
add the following
#pragma mark -
#pragma mark Gesture Recognizers
- (void)pinchGestureCaptured:(UIPinchGestureRecognizer*)gesture{
if(UIGestureRecognizerStateEnded == gesture.state){
///////////////////[self doWhatYouWouldDoInRegionDidChangeAnimated];
}
}
- (void)panGestureCaptured:(UIPanGestureRecognizer*)gesture{
if(UIGestureRecognizerStateEnded == gesture.state){
NSLog(@"panGestureCaptured ended");
// *************** Here it is *********************
///////////////////[self doWhatYouWouldDoInRegionDidChangeAnimated];
// *************** Here it is *********************
}
}
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
return YES;
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch: (UITouch *)touch{
return YES;
}
Edit: I have found another workaround here (all down at the bottom the above workaround is mentioned, too). I did not try out, but sounds promissing. I repeat it here:
私の回避策は簡単です。ViewControllerで、viewDidAppear:でMKMapViewを作成し、viewDidDisappear:で破棄します。これはInterfaceBuilderを使用している人にとってはフレンドリーな回避策ではないことを理解していますが、私の見解では、これは最もクリーンで、おそらくアプリのメモリを節約するための最良の方法です。