On Fri, Dec 12, 2008 at 9:41 AM, Jonathan del Strother
<maill...@steelskies.com> wrote:
> Maybe an example would be helpful.  Let's say I want to call
> -[Bartender mixCocktailIngredients:(NSString*)ingredient ...], and I
> want to call that with different arguments depending on the user's
> preferences.
> One way of doing so would be to use an if-statement, and just type out
> all the possibilities:

Why don't you just rewrite -mixCocktailIngredients: to take an NSArray
instead of variable arguments? Seems like that's ultimately what you
need anyway, so just change it to be more sane. If you really love
variable arguments then you can write a vararg version that calls
through to the NSArray version after marshaling the arguments.

Mike
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to