On Jan 13, 2009, at 8:32 AM, Horst Jäger wrote:
I have a problem concerning the va_list. I don't know how to programaticly create one.

I need to do this because I want to use the initWithFormat method of NSString. But I neither know how many args there will be nor are the args Strings - they are selectors the associated methods of which return Strings.

... rest of excellent problem description deleted ...

In short, you don't want to do this. Specifically, creating a vaargs list to be passed as a parameter to another method effectively requires encoding the arguments in whatever fashion the compiler would encode them. It is highly architecture specific and is rife with really awesomely tedious details that are easy to screw up.

On the system, the libffi API is available to assist with this. It provides a bit of insulation from the ABI, but not much.

---

Unless you are going to do this particular operation a bazillion times, it would be far easier to collect the strings via normal methods and then concatenate them together however you need.

b.bum_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to