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

前端 未结 9 1438
滥情空心
滥情空心 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:41

    You should generally prefix instance variables with something like an underscore (e.g. _variableName) to avoid compiler warnings like this.

    Otherwise just slightly change the names in your method signature, there is no hard defined naming convention.

提交回复
热议问题