简体   繁体   中英

Why is regionWillChangeAnimated: never called while panning?

The problem:

My MKMapViewDelegate 's - (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated selector is never called while i pan the map (but is called while zooming) in iPhone 5.0 simulator. It works as it should (or at least i suppose it should) on 4.3 simulator and 4.3 device. I don't have access to 5.0 device at the moment.

Situation:

I have a MKMapView instance (created in Interface Builder) - i double checked it in viewWillLoad

- (void)viewDidLoad {
    assert(self.myMapView);
    [self.stopMapView setDelegate:self];
}

I further define some of the MKMapViewDelegate 's selectors, but the ones that concern me are:

- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated
{
    RKLogDebug(@"Will Change map longSpan: %lf", mapView.region.span.longitudeDelta);
}

- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated
{
    RKLogDebug(@"Did Change map longSpan: %lf", mapView.region.span.longitudeDelta);
}

What's going on here? The delegate is not somehow informed about the 'panning' in the MKMapView while on iPhone 5.0 Simulator. I already tried to reset simulator content but to no avail. I wonder whether is it just some simulator bug or iOS5's intended behavior? (I'm on 10.7.2 & Xcode 4.2).

I added the two methods to my project. Tested iPhone 5.0 simulator: zooming / panning -> methods get called

I'm on 10.7.2 & Xcode 4.2 too.

So I can confirm it's not intented behavior as you thought it could be.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM