Re: Accessor methods and (auto)release: conclusion
Re: Accessor methods and (auto)release: conclusion
- Subject: Re: Accessor methods and (auto)release: conclusion
- From: Ondra Cada <email@hidden>
- Date: Tue, 6 Aug 2002 19:44:30 +0200
On Tuesday, August 6, 2002, at 07:36 , Marcel Weiher wrote:
...Deallocs should not have side-effects, they should just remove the
object in question.
Oh, so eg. all those [[NSNotificationCenter defaultCenter] removeObserver:
self] in so many of my -deallocs are all wrong? Gee.
I think the sentence of yours is just not true. Deallocs should have as
many sideeffects as needed for *proper removing the object in the
environment it lives* -- including things like keeping observer list up to
date, keeping any named lists (like the Window menu or whatever similar
one might have in one's applicaiton) up to date, closing potential sockets
the object might use, and who knows what more. Removing the object and
(auto)releasing all its ivars is a very important part of it -- but just a
part.
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.