• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: "Sherm Pendley" <email@hidden>
  • Date: Mon, 24 Mar 2008 00:18:50 -0400

On Sun, Mar 23, 2008 at 11:59 PM, charlie <email@hidden> wrote:

>
> 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.


You suppress the warning by fixing the problem it's warning you about. Yes,
it's just that simple.

For example, the above could be rewritten as:

- (void)setController:(id)newController {
    if (!controller) return;
    controller = [newController retain];
}

sherm--
_______________________________________________

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

  • Follow-Ups:
    • Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
      • From: Dave Hersey <email@hidden>
References: 
 >Re: How do I disable this warning: "local declaration of 'varname' hides instance variable" (From: "charlie" <email@hidden>)

  • Prev by Date: Re: Beginner with Cocoa
  • Next by Date: Re: Intercepting retain/release of object
  • Previous by thread: Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
  • Next by thread: Re: How do I disable this warning: "local declaration of 'varname' hides instance variable"
  • Index(es):
    • Date
    • Thread