• 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
Objective-C default arguments??
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Objective-C default arguments??


  • Subject: Objective-C default arguments??
  • From: Malcolm Sharman <email@hidden>
  • Date: Sat, 01 Nov 2003 16:51:44 +1000

Hi

I'm reasonably new to Objective-C and cocoa and I'm trying to make a simple
instance method of a class that takes a number of arguments.

-(void)initWithFile:(NSString *)path=@"" :(BOOL)setMovie=NO;

The above line of code is what I'm trying to do similar to what I can do in
plain c
void doSomething(int num1 = 1, int num2 = 2);

Am I way off track?? Do I have to use a variable argument list in
Objective-C to do the same thing??

I can probably get around this if I can't use default arguments by using two
methods, but it would be nicer to do it this way
Thanks for any help

Malcolm
_______________________________________________
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: Objective-C default arguments??
      • From: Wade Tregaskis <email@hidden>
    • Re: Objective-C default arguments??
      • From: Chris Hanson <email@hidden>
    • Re: Objective-C default arguments??
      • From: Malcolm Sharman <email@hidden>
  • Prev by Date: Re: Detecting login/logout?
  • Next by Date: Re: Objective-C default arguments??
  • Previous by thread: Re: Writing a freehand paint tool [Solved]
  • Next by thread: Re: Objective-C default arguments??
  • Index(es):
    • Date
    • Thread