Re: warning: local declaration hides instance variable
Re: warning: local declaration hides instance variable
- Subject: Re: warning: local declaration hides instance variable
- From: David Dunham <email@hidden>
- Date: Mon, 3 Sep 2007 17:56:09 -0700
On 3 Sep 2007, at 16:54, Jeff Laing wrote:
Depends on how much you like coding methods called:
-ism_myvar
-setm_myvar:
etc. KVC seems to default to property 'x' being implemented as
instance
variable 'x' or '_x'
Now, sure, you can row upstream and deliberately make your keypaths
different to your instance variable names. That way lies great
productivity...
Well, a lot of the time you need something like
- (void) setBullets: (NSString*) aString
{
[aString retain];
[fBullets release];
fBullets = aString;
}
anyway, so it's not like you're writing much extra code. And the
scope prefix ('f', from Apple's C++ style guide) always tells you
you're dealing with instance data.
And if you don't have Apple's guideline wired in, you can use the
prefix '_' and still make it clear what's instance data. You don't
have to write
- (NSString*) bullets { return _bullets; }
for KVM, but you still need to write the setter...
David Dunham A Sharp, LLC
Voice/Fax: 206 783 7404 http://a-sharp.com
Efficiency is intelligent laziness.
_______________________________________________
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