Re: A Data Object in Cocoa
Re: A Data Object in Cocoa
- Subject: Re: A Data Object in Cocoa
- From: Andy Lee <email@hidden>
- Date: Fri, 09 Jan 2009 10:33:56 -0500
On Jan 9, 2009, at 10:20 AM, glenn andreas wrote:
On Jan 9, 2009, at 9:13 AM, Andy Lee wrote:
I haven't checked, but I suspect the compiler chooses the right
thing, since this is only a warning. Maybe someone knows a way to
disable the warning? In Java, I wouldn't be surprised if there
were a way to enable a similar warning.
--Andy
Don't do that - compiler warning exist for reasons: to help prevent
you from writing buggy code.
In this case the warning isn't that the compiler is going to do the
"wrong" thing (since it basically gets to define what is right and
wrong - and it is right), it's that your code (or somebody else's
code who has to later maintain this code) is potentially going to
make a mistake and use "label" when they mean the instance variable,
and not "label" the parameter (and then things will break).
Compiler warning are basically its way of saying "I'm going to do
something that you told me to, but it may not be what you meant,
since what you wrote could be ambiguous or have undefined results".
Fix the warning, don't disable it.
True. Even if a way does exist to disable it, you should really avoid
it in the first place.
--Andy
_______________________________________________
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