Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
- Subject: Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
- From: "charlie" <email@hidden>
- Date: Mon, 24 Mar 2008 03:59:04 +0000
For years, I've been doing this:
- (void)setController:(id)_controller
{
if (!_controller)
{
return;
}
controller = [_controller retain];
}
It has always irked me having to work around namespace conflicts
between method args and instance variables.
So, today I decided to try this for my next project...
- (void)setController:(id)controller
{
if (!controller)
{
return;
}
self->controller = [controller retain];
}
I works fine. But does not fix the warning itself.
So, the question stands.... How do I suppress the warning.
- Chuck
On March 23, 2008, Michael Watson wrote:
If you've rewritten your code to fix the conflict, you shouldn't be
getting the warning. What does "coded around the namespace conflict"
mean, exactly?
--
m-s
On 23 Mar, 2008, at 22:56, charlie wrote:
Thanks.
I understand the reason behind the warning.
I've coded around the namrspace conflict.
Now I just want to suppress the warning.
- Chuck
On March 23, 2008, Andrew Farmer wrote:
On 23 Mar 08, at 19:29, charlie wrote:
How do I disable this warning?...
"local declaration of 'varname' hides instance variable"
Use a different name for either the local variable or the instance
variable. This is a serious enough warning that I really wouldn't
recommend disabling it.
_______________________________________________
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:
@bungie.org
This email sent to email@hidden
_______________________________________________
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