Re: Methods with the same name but different return types
Re: Methods with the same name but different return types
- Subject: Re: Methods with the same name but different return types
- From: Bill Bumgarner <email@hidden>
- Date: Fri, 03 Jun 2011 10:44:36 -0700
On Jun 3, 2011, at 8:15 AM, Jens Alfke wrote: The drawback is that, in this case, the compiler can’t figure out which version of the ‘overloaded’ selector is meant, which can cause trouble. That’s why you want that compiler warning on. But the warning has nothing to do with arrays; this can happen anyplace where an ‘id’ type is messaged.
What Jens said.
The best solution is to rename your method to avoid the collision.
The second best solution is to make sure that you explicitly typecast everywhere.
IIRC the compiler should warn if it sees two method declarations with incompatible types and it can't resolve which one to use in the context of the call.
b.bum |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden