I have read this question:
And i still don't really get how to use selectors with number of parameters.
Here is my code:
{
...
//add single tap gesture to the view
SEL mySelector = @selector(handleSingleTap:withScroll:);
UIGestureRecognizer* singleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:mySelector];
[myView addGestureRecognizer:singleTap];
...
}
and:
- (void)handleSingleTap:(UITapGestureRecognizer *)recognizer withScroll:(UIScrollView*)scroll {
...
}
But of course it will not work. the (UIScrollView*)scroll
is nil
at run time.
How can i set it to be (UIScrollView*)scroll
for instance?
Any help would be much appreciated.