Objective-C convention to prevent “local declaration hides instance variable” warning

前端 未结 9 1446
滥情空心
滥情空心 2020-12-08 04:50

I am using the following code ...

-(id) initWithVariableName:(NSString*)variableName withComparisonValue:(NSString*)comparisonValue {

    // super init
             


        
9条回答
  •  广开言路
    2020-12-08 05:29

    _varName = varName;
    

    You can use just this but without the @synthesize - whenever you want to use that variable you just write _*variable name* and it eliminates the error

提交回复
热议问题