Automatically releasing retained @property values
January 12, 2010 04:03 PM
| Cocoa, Development, Mac
| Permalink
I subscribe to the opinion, that setters should not be called in constructors nor in destructors. This negates some of the benefits of @synthesize accessors. Indeed, one needs to keep the dealloc method in sync with the setter semantics. Our dealloc methods thus look like this:- (void)dealloc{ // Retained properties [_firstProperty release], _firstProperty = nil; [_thirdProperty release], _thirdProperty
Comments (3)