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

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


  • Subject: no fixed variable parameter preceding a variable ... parameter?
  • From: Ben Dougall <email@hidden>
  • Date: Sat, 25 Oct 2003 18:47:53 +0100

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: mmalcolm crawford <email@hidden>
    • Re: no fixed variable parameter preceding a variable ... parameter?
      • From: Jonathan Wight <email@hidden>
    • Re: no fixed variable parameter preceding a variable ... parameter?
      • From: "Alastair J.Houghton" <email@hidden>
  • Prev by Date: Re: Where is Xcode?
  • Next by Date: NSTableViewSelectionDidChangeNotification not posted on time
  • Previous by thread: Re: Add and delete buttons for tables?
  • Next by thread: Re: no fixed variable parameter preceding a variable ... parameter?
  • Index(es):
    • Date
    • Thread