Re: Clarification on accessors? (was: Yet another memory management question)
Re: Clarification on accessors? (was: Yet another memory management question)
- Subject: Re: Clarification on accessors? (was: Yet another memory management question)
- From: Jim Correia <email@hidden>
- Date: Sat, 11 Jul 2009 10:09:50 -0400
On Jul 9, 2009, at 5:52 PM, Charles Srstka wrote:
On Jul 9, 2009, at 4:29 PM, Ben Trumbull wrote:
It may be that under certain circumstances (dictionary storage,
synthesized properties on 10.5, etc) that you must use an accessor
method even in init & dealloc. That requires more care, is more
error prone, and less flexible. In particular, additional behavior
should not be adorned to the accessor, and the accessor must never
leak knowledge of the receiver to a third party during init or
dealloc. Basically, these accessors must be very very boring.
But if it's a synthesized accessor, wouldn't it be pretty much a
given that that would be the case?
That will be the case for your class, with its synthesized accessors.
If a subclass overrides those accessors, though, you'll be invoking
them during setup and teardown too.
The overridden accessors, by definition, add side effects or behavior.
- Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden