• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: variable arguments in ObjC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: variable arguments in ObjC
      • From: Manfred Lippert <email@hidden>
References: 
 >variable arguments in ObjC (From: Nicholas Shanks <email@hidden>)

  • Prev by Date: Re: Programming NSImageView
  • Next by Date: RE: variable arguments in ObjC
  • Previous by thread: Re: variable arguments in ObjC
  • Next by thread: Re: variable arguments in ObjC
  • Index(es):
    • Date
    • Thread