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: j o a r <email@hidden>
- Date: Sun, 23 Mar 2008 21:12:57 -0700
Chuck,
* You really shouldn't suppress these warnings
* If you use ObjC 2.0 properties you don't have to write those
accessors in the first place, and
* If you use ObjC 2.0 properties, you can use this form without
warnings:
self.foo = foo;
j o a r
On Mar 23, 2008, at 8:59 PM, charlie wrote:
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
_______________________________________________
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