Re: Future Objective-C changes
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.