• 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
Passing on a variable arg list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing on a variable arg list


  • Subject: Passing on a variable arg list
  • From: Charlie Dickman <email@hidden>
  • Date: Thu, 26 Apr 2012 22:15:20 -0400

Good people,

In standard C a variable argument list can be passed on to a called function as follows...

func2(type1 arg1, char *f, ...)  {
va_list(ap);
va_start(ap, f1);
func2_guts(arg1, f, args);
va_end(ap);
}

func2_guts(type1 arg,  char *f, va_list ap) {
.
.
.
}

In func2_guts ap enters as an already prepared va_list so no va_list or va_start or va_end is needed.


How does one do this in  Xcode Objective C? To be clear, I 'm not asking how to use variable arg lists as I already know how to do that. I am asking how to pass a variable arg list in 1 function on to a second one?

I can not find the documentation on how to do this.

P.S. A variadic macro can't be used because the arg lists are not known at compile time.

Charlie Dickman
email@hidden




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Passing on a variable arg list
      • From: Charlie Dickman <email@hidden>
  • Prev by Date: Re: Tweak auto-completion
  • Next by Date: Re: Passing on a variable arg list
  • Previous by thread: Re: Tweak auto-completion
  • Next by thread: Re: Passing on a variable arg list
  • Index(es):
    • Date
    • Thread