Re: variadic args
Re: variadic args
- Subject: Re: variadic args
- From: Charlie Dickman <email@hidden>
- Date: Wed, 23 May 2012 23:08:42 -0400
The documentation for NSInvocation states...
NSInvocation does not support invocations of methods with either variable numbers of arguments or union arguments.
On May 23, 2012, at 11:03 PM, Jens Alfke wrote: On May 23, 2012, at 7:43 PM, Charlie Dickman wrote: If I have some integer values in an array like {1, 2, 0} is there a way I can convert them to a var_arg list at runtime so that I can pass them to a method that is defined to take a var_arg list. In other words can I turn them into a call like
[self method: 1, 2, 0];
where method looks like
- (void) method: _1st, ... {
Only by messing with the NSInvocation class, which lets you assemble and invoke a method-call programmatically. But it's sort of tricky, and rather expensive compared to a normal method call.
—Jens
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden