|
|
|
|
|
by pashields
5372 days ago
|
|
Can you expand on this, as the resistance to this style has always confused me. The concern you are presenting is that a subclass could implement the setFoo method, and do so in a way that: 1) does not call [super setFoo:], and 2) does not follow the convention of handling memory management appropriately? My problem with this argument is that the user could botch release just as well. Maybe they are slightly more likely to botch the setter, but either way they are botching it. |
|
Since your object is likely to be dealloced at an odd time (for instance when an autorelease pool is drained), and in an inconsistent state (half its fields missing), it's much better to do a release.