Re: Using va_list to build a formatted string

2016-06-29 Thread Graham Cox
Got it, thanks! —Graham > On 30 Jun 2016, at 12:45 PM, Wim Lewis wrote: > > You need to use -stringWithFormat:arguments: here, since you're passing in a > va_list of arguments. > > ___ Cocoa-dev mailing list

Re: Using va_list to build a formatted string

2016-06-29 Thread Wim Lewis
On Jun 29, 2016, at 7:38 PM, Graham Cox wrote: > va_list argsP; > va_start( argsP, format ); > > logString = [NSString stringWithFormat:format, argsP]; You need to use -stringWithFormat:arguments: here, since you're passing in a va_list of

Using va_list to build a formatted string

2016-06-29 Thread Graham Cox
Hi all, Got a problem with variadic arguments. I have a function thus: voidXVLogEvent( NSString* format, ... ) { NSString* logString; va_list argsP; va_start( argsP, format ); logString = [NSString stringWithFormat:format, argsP];