when my gesture of clicking the arrow, I need to send an additional argument along with it, but I have to do something really stupid, which I am doing wrong here:
Here is my gesture created and added:
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:itemSKU:)]; tapGesture.numberOfTapsRequired=1; [imageView setUserInteractionEnabled:YES]; [imageView addGestureRecognizer:tapGesture]; [tapGesture release]; [self.view addSubview:imageView];
This is where I process it:
-(void) handleTapGesture:(UITapGestureRecognizer *)sender withSKU: (NSString *) aSKU { NSLog(@"SKU%@\n", aSKU); }
and this will not be executed due to the initialization string of UITapGestureRecognizer.
I need to know something identifiable about which image was clicked.
source share