我在一个ViewController中有一个MKMapView
,希望能够使用以下方法检测用户的手势:
- (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上运行良好,但是当我在运行iOS 5的iPhone上调试应用程序时,我看到了这条消息:
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种方法中的代码没有被执行。
您知道如何解决这个问题吗?
谢谢。