I have the following:
UITapGestureRecognizer *tapGesture;
SEL sel = @selector(profilePop:withUser:) withObject:tapGesture withObject:message.creator;
tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:sel];
and I want it to be able to call:
- (void)profilePop:(UITapGestureRecognizer *)recognizer withUser:(Login *)user
{
//some code here
}
but why isn’t it doing so?
A selector only knows about its name and any parameter names, not its arguments.
UIGestureRecognizeronly accepts actions which take in either zero or one argument of its type.In order to do what you want, you’ll need to write a wrapper method to pass off a
Logininstance toprofilePop:withUser:.So, you’d write something like this: