Objective-C convention to prevent "local declaration hides instance variable" warning
Posted
by Nippysaurus
on Stack Overflow
See other posts from Stack Overflow
or by Nippysaurus
Published on 2010-03-29T22:38:00Z
Indexed on
2010/03/29
22:43 UTC
Read the original article
Hit count: 307
objective-c
Is there a common convention for dealing with these scenarios? The following code is what I am using ..
-(id) initWithVariableName: (NSString*)variableName withComparisonValue:(NSString*)comparisonValue {
self.mustExist = NO;
self.reverseCondition = NO;
self.regularExpression = NO;
self.variableName = variableName;
self.comparisonValue = comparisonValue;
return self;
}
But I am getting "Local declaration of 'variableName' hides instance variable" and the same for "comparisonValue". The function signature seems logical to me, but surely there must be a more "acceptable" standard which will still make sense and be accurate but not generate annoying warnings?
© Stack Overflow or respective owner