Re: Programmatically determining number of arguments a selector takes
Re: Programmatically determining number of arguments a selector takes
- Subject: Re: Programmatically determining number of arguments a selector takes
- From: Scott Thompson <email@hidden>
- Date: Fri, 3 Jun 2005 12:49:25 -0500
On Jun 3, 2005, at 3:30 AM, Andrew White wrote:
I have some callback code that requires the user to pass in a
selector. I'd like to validate that the selector is of the correct
form - it must take exactly one argument.
I've searched through the doco and have not been able to find a
function that will tell me how many args an object of type SEL
requires. Does something like this exist?
I imagine that, since selectors can take variable argument lists,
there is no way to find this information. The number of arguments to
a selector is usually encoded in the selector name. (i.e. a two
argument selector will be performFoo:withBar: while a one argument
selector will be doFoo:)
Is there an easy way to allow such selectors to return 'void', or
is it simpler to just ignore the (id) return value? NSInvocation
is a bit heavyweight for what I'm doing.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden