views:

665

answers:

2

I have a controller containing a MKMapView. I retain it when the user pops back to the previous controller and then push it back when the user want to return to the map. The problem occurs when an amination is in progress when the user leaves the controller. When I re push the controller the animation is on the screen frozen in the state it was in when the controller was popped. When the user touches the screen the view updates and is fine. I have tried adding

[mapView setNeedsDisplay];

with no luck. Any ideas?

+1  A: 

I had a similar issue when I was programmatically scrolling to a spot in general, even if the view wasn't left. Calling regionThatFits: with the region I wanted seemed to fix it, but I haven't investigated why yet. Not sure if this would fix your issue, but worth a shot maybe?

criscokid
A: 

I ended up fixing this by toggling the current location annotation. This seems to force the map to update in the way I needed.

mapView.showsUserLocation = NO;
mapView.showsUserLocation = YES;
Joe Cannatti