Re: variable arguments in ObjC
Re: variable arguments in ObjC
- Subject: Re: variable arguments in ObjC
- From: Nicholas Shanks <email@hidden>
- Date: Fri, 22 Feb 2002 17:09:48 +0000
Now I've got this thing almost working, but I'm losing the first argument.
Any ideas where it's gone?
[[Something alloc] initWith:@"one", @"two", @"three", @"four", @"five",
nil]
- (id)initWith:(id)item, ...
{
va_list list;
va_start( list, item );
NSLog( @"va_list started" );
id current;
while( current = va_arg( list, id ) )
NSLog( @"arg processed %@", [current description] );
va_end( list );
NSLog( @"va_list ended" );
return self;
}
produces:
va_list started
arg processed two
arg processed three
arg processed four
arg processed five
va_list ended
what happened to number 1?
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.