@interface Article : NSObject @property (nonatomic, strong) NSString *imageURLString; @end @implementation Class @synthesize imageURLString = _imageURLString; - (void)setImageURLString:(NSString *)imageURLString { _imageURLString = imageURLString; //do something else }
Did I correctly override the setter when ARC is enabled?
Yes, this is correct. Also took me a while to trust that this is indeed the right thing to do.
You do realize that in this case, the override is not necessary as you don't do more than the standard generated setter would do? Only if you add more code to setImageURLString:
would you need to override the setter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With