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