• 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: Suppressing variable hiding warning in Xcode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suppressing variable hiding warning in Xcode


  • Subject: Re: Suppressing variable hiding warning in Xcode
  • From: Bill Bumgarner <email@hidden>
  • Date: Sun, 05 Apr 2009 18:06:29 -0700

On Apr 5, 2009, at 5:10 PM, Brad O'Hearne wrote:
1. I get the gist of trying to prevent developers from accidentally hiding variables -- but is this really a major problem? Other than this, is there a compelling reason to keep this warning in tact, and change variable parameter variable names to make the warning go away?

Yes. Most -- not all, but most -- Objective-C programmers tend to shy away from various prefix/suffix solutions for marking instance variables, preferring to go with more english like names. Apple uses _ to indicate "internal, don't touch", but not with 100% consistency.


Argument names are typically somewhat descriptive of their purpose -- newOrigin, notificationName, userInfo -- or totally generic, while remaining descriptive -- aSize, anError, etc...


2. How do you get Xcode to not produce this warning?

Don't. You'll thank yourself for not doing so after spending a few hours wondering why an iVar didn't get updated only to find that a parameter hid the iVar.


b.bum

_______________________________________________

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: Suppressing variable hiding warning in Xcode
      • From: Graham Cox <email@hidden>
References: 
 >Suppressing variable hiding warning in Xcode (From: Brad O'Hearne <email@hidden>)

  • Prev by Date: Re: Suppressing variable hiding warning in Xcode
  • Next by Date: Re: Cocoa user pane equivalent?
  • Previous by thread: Re: Suppressing variable hiding warning in Xcode
  • Next by thread: Re: Suppressing variable hiding warning in Xcode
  • Index(es):
    • Date
    • Thread