6
我有一个MKMapView
在一个视图控制器,并想检测用户的手势时,他/她倒是这些方法地图:检测用户触摸的iOS 5
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
的应用程序正常工作与iOS 3,iOS 4的 但是当我调试应用程序与iPhone上的iOS 5运行时,我看到这条消息:
Pre-iOS 5.0 touch delivery method forwarding relied upon. Forwarding -touchesCancelled:withEvent: to <MKAnnotationContainerView: 0x634790; frame = (0 0; 262144 262144); autoresizesSubviews = NO; layer = <CALayer: 0x634710>>
和上述4种方法的代码没有达到。
你知道如何解决它吗?
谢谢。
无法评论iOS 5,但对于3.2到4,使用UIGestureRecognizer而不是触摸方法可能更容易。 – Anna
http://stackoverflow.com/questions/1049889/how-to-intercept-touches-events-on-a-mkmapview-or-uiwebview-objects ..检查此链接 – Kalpesh