Re: Why can't I name a property `tag'?
Re: Why can't I name a property `tag'?
- Subject: Re: Why can't I name a property `tag'?
- From: "Michael Ash" <email@hidden>
- Date: Thu, 10 Jul 2008 12:44:08 -0400
On Thu, Jul 10, 2008 at 9:49 AM, an0 <email@hidden> wrote:
> Thanks. But isn't it annoying for XCode to pretend to know something
> for sure while in fact it is just a wrong guess? At least the warning
> is very misleading.
The warning isn't misleading at all. Xcode is not pretending anything.
It *does* know it for sure, it's just *wrong*. The warning then
appears because this wrong information causes other problems in the
code later on, due to a mismatched type.
The compiler definitely should complain if it has two methods with the
same name but different return types to choose from, and it doesn't
know which one is right. I've seen it happen many times. If it didn't
happen to you, it's because either it wasn't seeing one of them, or
because you found a compiler bug.
This is an inherent hazard of using the "id" type. For best results,
you should avoid using any method name which is already in use unless
your return type is compatible with the one already in use.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden