• 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: no fixed variable parameter preceding a variable ... parameter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: no fixed variable parameter preceding a variable ... parameter?


  • Subject: Re: no fixed variable parameter preceding a variable ... parameter?
  • From: Jonathan Wight <email@hidden>
  • Date: Sat, 25 Oct 2003 16:16:31 -0500

Copy the way -[NSArray arrayWithObjects] works.

+ (id)arrayWithObjects:(id)firstObj, ...

A NULL in an parameter in the list terminates the list.

Jon.

> From: Ben Dougall <email@hidden>
> Date: Sat, 25 Oct 2003 18:47:53 +0100
> To: email@hidden
> Subject: no fixed variable parameter preceding a variable ... parameter?
>
> is there anyway to declare a method to take a variable number of
> arguments, *without* an initial fixed argument, like this:
>
> - (void)takeTheseObjects: ...
> {
> // (don't worry about this part, it's just the above method
> // name/parameter line that i'd like to know about)
> }
>
> when i try and compile a method that has that declaration line the
> compiler says:
> TestClass.h:16: illegal keyword selector, missing `identifier' after `:'
> In file included from main.m:3:
> TestClass.h:16: parse error before '...' token
>
> so i tried:
> - (void)takeTheseObjects:(id)...
> which gave different errors.
>
> this compiles fine, because of the initial fixed parameter:
> - (void)takeTheseObjects:(unsigned)anything, ...
> {
> // .....
> // .....
> }
>
> i've tried a number of combinations of things to try and achieve no
> fixed variables but no good. anyone know of a way?
>
> thanks, ben.
_______________________________________________
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.

  • Follow-Ups:
    • Re: no fixed variable parameter preceding a variable ... parameter?
      • From: Ben Dougall <email@hidden>
References: 
 >no fixed variable parameter preceding a variable ... parameter? (From: Ben Dougall <email@hidden>)

  • Prev by Date: XCode/Panther issues
  • Next by Date: New Perl in Panther
  • Previous by thread: Re: no fixed variable parameter preceding a variable ... parameter?
  • Next by thread: Re: no fixed variable parameter preceding a variable ... parameter?
  • Index(es):
    • Date
    • Thread