Re: Variable arguments at runtime modification
Re: Variable arguments at runtime modification
- Subject: Re: Variable arguments at runtime modification
- From: Chris Ridd <email@hidden>
- Date: Sun, 12 Oct 2003 15:50:51 +0100
On 12/10/03 3:34 pm, Bertrand Mansion <email@hidden> wrote:
>
query = [NSString stringWithFormat:format, XXX];
>
>
return [self queryWithString:query];
>
}
>
>
I know how to encode the data, etc. What I don't know, is how to make a new
>
va_list with the new encoded datas (shown as XXX in the snippet above) and
>
pass it to stringWithFormat. Is this even possible or should I go for
>
another solution ?
It is possible to express this in ISO C - look at the vprintf family of
functions. You end up passing your va_list variable as a single parameter to
the function. I can't see any reason why an Objective C method couldn't be
written to take a va_list argument.
However NSString does not seem to have a variant of the stringWithFormat
class method that takes a va_list argument, so you're sadly out of luck. It
sounds like a relatively useful and straightforward extension, so you could
raise an enhancement request on Radar.
>
I would really appreciate some help, let me know if my explanations weren't
>
clear enough.
>
Thanks,
Cheers,
Chris
_______________________________________________
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.