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: Jeff Laing <email@hidden>
- Date: Thu, 9 Jul 2009 02:28:11 +0000
- Acceptlanguage: en-US
- Thread-topic: Clarification on accessors? (was: Yet another memory management question)
> Because you have no idea what subclassers may do in their overrides of
> the accessors
Sort of invalidates the whole encapsulation promise of OO design, doesn't it?
> (e.g. The subclassed accessor may rely on state that's
> been torn down earlier in -dealloc).
But any subclass that's going to override an accessor has had its dealloc method called already, so it should know to have put back anything that matters. Now, if you want to design based on the assumption that everyone else will do a crappy job, that's a different story.
> It's just not safe, unless you can guarantee that you own the entire
> inheritance chain.
Someone more knowledgeable than me should bring up the discussion about using the need to use the 'view' set-accessor in dealloc of subclassed view controllers, I think it was.
_______________________________________________
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