以下代码不适用于 iOS 5 和 iOS 5.1(但适用于 iOS 6):
- (void)viewDidLoad {
...
UILongPressGestureRecognizer* gesture = [[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)] autorelease];
[myWebView addGestureRecognizer:gesture];
}
- (void)handleLongPress:(UIGestureRecognizer*)gestureRecognizer {
...
}
如何解决问题?非常感谢您的帮助!