title: Variable args in an iPhone ObjC function
body: <p>I must be stuck on stoopid today because I spent over an hour trying to understand how to make variable args work in this iPhone project I'm working on. Could somebody help me get a green bar in the below unit test? Where am I going wrong?</p>
  
  <pre><code>#import &lt;SenTestingKit/SenTestingKit.h&gt;
  
  @interface VAArgsTest : SenTestCase
  {
  
  }
  
  @end
  
  NSString* vaArgsAppend(NSString *first, ...)
  {
    NSMutableString *list = [[NSMutableString alloc] initWithString:first];
    id eachArg;
    va_list argumentList;
    va_start(argumentList, first);
    while(eachArg = va_arg(argumentList, id)) {
      if(eachArg)[list appendString:(NSString*)eachArg];
    }
    va_end(argumentList);
    return [list autorelease];
  }
  
  @implementation VAArgsTest
  
  -(void) testCallVaArgsAppend
  {
    NSString *result = vaArgsAppend(@"one ", "two ", @"three");
    STAssertEqualObjects(result, @"one two three", @"Expected appended string.");
  }
  
  @end
  </code></pre>