Call selector on static methods from separate class
ios5, objective-c
Solution
The syntax is:
UITapGestureRecognizer * c1 = [[UITapGestureRecognizer alloc]
initWithTarget:[MyGestureRecognizer class]
action:@selector(ViewWasClicked1:)]; // error
Problem
let's say I want to create the following gesture recognizer ``` UITapGestureRecognizer * c1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector([[MyGestureRecognizer ViewWasClicked1:]]; // error [c1 setNumberOfTapsRequired:1]; [c1 setNumberOfTouchesRequired:1]; [[self view] addGestureRecognizer:c1]; ``` but I want to call the selector on a separate class. I have the method: ``` + (void)ViewWasClicked1:(UITapGestureRecognizer *)sender { NSLog(@"click1 mouse down"); } ``` in the class MyGestureRecognizer. is it possible to what am I looking for?