Re: Is Apple's singleton sample code correct?
Re: Is Apple's singleton sample code correct?
- Subject: Re: Is Apple's singleton sample code correct?
- From: Shawn Erickson <email@hidden>
- Date: Sat, 26 Nov 2005 08:31:18 -0800
On Nov 26, 2005, at 8:12 AM, Shawn Erickson wrote:
It of course also relies on overriding retain/release (and others
as needed) to allow normal use of retain and release without
affecting the existence of the singleton.
This was poorly stated... I was trying to say that a singleton can be
implemented to be lazily allocated and with the assumption it will
exist for the life of the process. This assumption can lead to
implementation choices in the singleton that require it has no chance
of being dealloced and in order to defend against that you can rely
on overriding retain/release/etc. Again just a choice of attempting
to be defensive compared to relying on the detection of a usage
defect... which makes sense is often a matter of opinion and can
depend on the situation.
Anyway likely enough on this subject... (as you see I try not to
speak in absolutes since seldom anything in programming styles/
patterns truly are).
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden