Override setter method and get “Local declaration of xxx hides instance variable”
问题 I have a integer variable, for example, timeSignature, declared it in .h file, and synthesized a pair of setter/getter methods: in .h: @interface Metronome : NSObject { int timeSignature; } @property (nonatomic) int timeSignature; in .m: @synthesize timeSignature; I wish to override the setter method: when user set a new value to it, it does something else as well as changing to new value: - (void) setTimeSignature:(int)timeSignature { self.timeSignature = timeSignature; //hides instance