I want to override the getter and setter in my ObjC class using ARC.
.h File
@property (retain, nonatomic) Season *season;
.m File
The thing you’re missing is that the Objective-C compiler basically turns the self.foo = bar
syntax into [self setFoo:bar]
, and self.foo
into [self foo]
. Your methods, as currently implemented, are calling themselves. As Jeremy suggests, you need to implement them such that the setter actually assigns the value it’s called with to an instance variable on your class and the getter returns the value of that instance variable.