我有一系列imageview
安排,并为它分配一个TapView
识别器
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc]
initWithTarget:self action:@selector(action:)];
[tapRecognizer setNumberOfTouchesRequired:1];
[tapRecognizer setDelegate:self];
imageView.userInteractionEnabled = YES;
[imageView addGestureRecognizer:tapRecognizer];
我将选择器定义为:
-(void) action:(id)sender
{
NSLog(@"TESTING TAP");
NSLog (@"%d",[sender tag]);
}
这正在崩溃,我收到错误消息:-
[UITapGestureRecognizer tag]: unrecognized selector sent to instance 0x145d0210