title: How to determine whether a @selector wants a parameter?
body: <p>The scenario presents itself where I have an object that stores an outside @selector for later use. By design, I would like to be able to add two kinds of selectors. The simple one, without parameters, like <code>[object add:@selector(doSomething)]</code>, and the more complex one, with one parameter, like <code>[object add:@selector(doSomething:)]</code> (mind the colon). Let's say the selector is stored in a variable <code>SEL mySelector</code>.</p>
  
  <p>In the execution, I need to decide between <code>[anotherObject performSelector:mySelector]</code> or <code>[anotherObject performSelector:mySelector withObject:userInfo]]</code>.</p>
  
  <p>The way I implemented this decision, is by providing a BOOL flag that redundantly stores whether the performance should be with or without the extra parameter. Yet although I can't find this in the docs, I have the feeling that I should also be able to ask the selector something like <code>-(BOOL)needsParameter</code>. I know, for example, that UIGestureRecognizer's addTarget:action: somehow makes this distinction automatically.</p>
  
  <p>Could someone point me in the right direction?</p>