• 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: Future Objective-C changes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Future Objective-C changes


  • Subject: Re: Future Objective-C changes
  • From: Julian Barkway <email@hidden>
  • Date: Fri, 16 May 2003 08:41:25 +0200

>With regards to method overloading, I thought it may be useful to be
>able to say:
>
>-(int)doSomethingWithFoo:(Foo*)y;
>-(int)doSomethingWithFoo:(int)y;
>
>With method overloading the compiler could resolve most of the
>parameter type issues without me having to create different method
>names just because the parameter type is different.
>
>David.

But you can already use something like:

-(int)doSomethingWithFoo:(id)y;

and invoke it with:

int bar;
Foo *f;
[x doSomethingWithFoo: [NSNumber numberWithInt: bar]];
[x doSomethingWithFoo: f];

or however you want. Not as elegant, perhaps, and you lose compile-time type-checking but certainly doable.

Cheers,
Julian Barkway.
_______________________________________________
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: Future Objective-C changes
      • From: David Cittadini <email@hidden>
  • Prev by Date: Re: Future Objective-C changes
  • Next by Date: Fwd: Future Objective-C changes
  • Previous by thread: Re: Future Objective-C changes
  • Next by thread: Re: Future Objective-C changes
  • Index(es):
    • Date
    • Thread