Re: warning: local declaration hides instance variable
Re: warning: local declaration hides instance variable
- Subject: Re: warning: local declaration hides instance variable
- From: Tron Thomas <email@hidden>
- Date: Mon, 03 Sep 2007 13:44:11 -0700
Laurence Harris wrote:
An even better solution would be to rename your instance variables
with a standard naming convention that clearly identifies them as
instance variables. Since they're also referred to as member
variables, a lot of people prefix their names with an "m":
@interface Value : Object
{
@private
int mAmount;
}
Given how helpful this is I can't imagine not using a naming
convention that immediately differentiates local and instance
variables. A naming convention to differentiate parameters is also
helpful.
Larry
When I'm programming in C++ I'm always in the habit of declaring member
variables with an "m_" prefix. Placing an "m" or "m_" before a variable
doesn't really seem to be a convention in Objective-C. Most people when
they declare an Interface Building outlet don't prefix the outlet name
with anything, and the outlets available from Cocoa class don't prefixes
either. The outlets basically show up as public instance variables in
the class declaration.
It seems inconsistent for some member to have a prefix and some to not
have the prefix. For this reason, I tend to avoid prefixing Objective-C
member variables that way.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden