Re: Protecting singleton objects from releasing
Re: Protecting singleton objects from releasing
- Subject: Re: Protecting singleton objects from releasing
- From: Angela Brett <email@hidden>
- Date: Sat, 15 Feb 2003 01:11:19 +1300
Is there any "recommended" way to protect singleton objects (e.g.
[NSProcessInfo processInfo]) from releasing? Overriding the release
method comes in mind, but I am wondering if there are better ways...
Why do you want to do that? It seems to me that if anyone releases an
object, singleton or otherwise, which they have not alloced, copied
or retained, is at fault for doing so. The class shouldn't be
protecting client code from its own errors. If the singleton is
accessed through [NSProcessInfo processInfo] or similar then it ought
not be released anyway unless it's retained first, and it's not
NSProcessInfo's job to police that. Or is there a more advanced
concept here which I'm missing?
--
Angela Brett
email@hidden
http://acronyms.co.nz/angela
_______________________________________________
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.