• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ***Junkmail*** How do I programaticly create a va_list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ***Junkmail*** How do I programaticly create a va_list


  • Subject: Re: ***Junkmail*** How do I programaticly create a va_list
  • From: Bill Bumgarner <email@hidden>
  • Date: Tue, 13 Jan 2009 08:48:45 -0800

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 (email@hidden)

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: ***Junkmail*** How do I programaticly create a va_list
      • From: Jeff LaMarche <email@hidden>
References: 
 >***Junkmail*** How do I programaticly create a va_list (From: Horst Jäger <email@hidden>)

  • Prev by Date: Re: Killall Finder Brings Hidden Apps To Front?
  • Next by Date: Re: Killall Finder Brings Hidden Apps To Front?
  • Previous by thread: ***Junkmail*** How do I programaticly create a va_list
  • Next by thread: Re: ***Junkmail*** How do I programaticly create a va_list
  • Index(es):
    • Date
    • Thread