objective c - How do I write the method name of a variadic method that also contains known arguments? -
i'm trying make method accept unknown number of arguments, , known number of other arguments. i'm wondering syntax of naming method. method body seems fine.
i realize make method take known arguments first , unknown arguments , this:
-(id)init: (nsstring*)type withmodifier:(nsstring*)mod withnames:(nsstring*)names,...;
i'm looking list unknown arguments first, followed known arguments. how name method this?
this i'm trying do, proper syntax of course:
-(id)initwithnames: (nsstring*)names,... withtype:(nsstring*)type withmodifier:(nsstring*)mod;
thanks help.
you can't - the variadic argument must last one. try
initwithtype:(nsstring *)t modifier:(nsstring *)m names:(nsstring *)n, ...
instead.
Comments
Post a Comment