MkMapView setRegion animation prevents touch events on Annotation Views

Posted by Vlad Gurovich on Stack Overflow See other posts from Stack Overflow or by Vlad Gurovich
Published on 2010-04-02T03:38:55Z Indexed on 2010/04/02 3:43 UTC
Read the original article Hit count: 514

Hi there! We have a MKmapView with a bunch of Image Annotation where each Image annotation responds to touch by overriding these methods of AnnotationView subclass:

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event

Our map region is updated using

[MkMapView setRegion:animated:]

whenever the new location is received and is far enough from the old location to make a difference.

What I noticed is that if we set animated flag to YES the touches on our annotation are rarely detected(probably due to the fact that main thread is busy animating between two map regions. When we set animated flag to NO, everything is fine, but map transition may(or may not) become jerky.

The question I have is whether this is an expected behavior of animated flag of [MkMapView setRegion:animated] function or whether there is a workaround for this issue.

Thanks in advance

© Stack Overflow or respective owner

Related posts about iphone-sdk-3.0

Related posts about mkmapview