Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Override setter with arc

@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?

like image 601
rowwingman Avatar asked Oct 28 '11 14:10

rowwingman


1 Answers

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.

like image 163
Pascal Avatar answered Sep 20 '22 13:09

Pascal