Re: variable arguments in ObjC
Re: variable arguments in ObjC
- Subject: Re: variable arguments in ObjC
- From: Christophe Dore <email@hidden>
- Date: Fri, 22 Feb 2002 14:58:49 +0100
Do you mean Objc ?
well : try
-(void) myMethod:obj withVars:(id) first,....
{
va_list args;
id argument;
va_start(args,first);
while((argument=va_arg(args,id))!=nil)
{
...
}
va_end(args);
}
Nicholas Shanks wrote:
I want to write a function with a variable number of arguments, all
"id"s,
and the last one being nil. (The same as NSArray's initWithObjects)
The only mention of this in association with Objective C I can find is
on a page saying "you can't do this with java", but doesn't say how to
do it with Cocoa! (http://www.bignerdranch.com/Resources/Java.html)
Can anyone point me in the right direction?
Nicholas Shanks
--
http://nickshanks.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.