News for hackers. Stuff that matters.
Re:Stop the Hate: Obj-C Deserves Your Love by ant5 on Tuesday July 13, 2010 @12:42PM (#1511919)
Like any other vararg function:

  + (NSString) stringWithFormat: (NSString *) format, ... {
      NSString *string;
      va_list ap;
  
      /* Fetch the arguments */
      va_start(ap, format);
      // Could iterate over the arguments yourself here, or just use:
      CFStringRef cfString = CFStringCreateWithFormatAndArguments(NULL, NULL, (CFStringRef)format, args);
      string = [NSMakeCollectable(cfString) autorelease];
      va_end(ap);
  
      return string;
  }

There are no comments on this comment yet.