假设我想创建以下手势识别器
UITapGestureRecognizer * c1 = [[UITapGestureRecognizer alloc]
initWithTarget:self
action:@selector([[MyGestureRecognizer ViewWasClicked1:]]; // error
[c1 setNumberOfTapsRequired:1];
[c1 setNumberOfTouchesRequired:1];
[[self view] addGestureRecognizer:c1];
但我想在一个单独的类上调用选择器。我有方法:
+ (void)ViewWasClicked1:(UITapGestureRecognizer *)sender {
NSLog(@"click1 mouse down");
}
在 MyGestureRecognizer 类中。我在寻找什么有可能吗?