views:

159

answers:

1

Hello

I have a function -(id) func: params1, ... NS_REQUIRES_NIL_TERMINATION and2: params2, ... NS_REQUIRES_NIL_TERMINATION;

Compiler says: error: expected `;' before 'and2' Is there any way to make function with 2 argument lists?

+3  A: 

Simply put: No. It is not possible.

There is, however, a workaround available; you can pass instead two pointers to id that work out to nil-terminated arrays, like so:

- (id)method:(id *)part_one withTwo:(id *)part_two

Edit: As an alternative, the list could be nil-terminated twice. (Now that is weird!)

Williham Totland
+1 for weirdness
Dave DeLong
Not at all weird; you see it with NSDictionary, IIRC; `- (id)initWithObjects:(id *)objects forKeys:(id *)keys count:(NSUInteger)count` (It's a similar concept, but with the count thrown in as an optimization.)
Williham Totland
@Williham touché; to my own defense, I almost *never* use that initializer on `NSDictionary`. ;)
Dave DeLong