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: Scott Anguish <email@hidden>
- Date: Sun, 27 Nov 2005 18:57:00 -0500
On Nov 27, 2005, at 3:19 PM, David Gimeno Gost wrote:
No such supporting mechanisms exist for Cocoa/Objective-C AFAIK. In
Objective-C, to properly handle singleton destruction at the end of
the program, someone has to take ownership of the shared instance
and send it a -release message... assuming the singleton hasn't
been designed to prevent this method from actually doing anything
useful, that is.
there is no reason that an app will quit notification couldn't do
whatever cleanup is required of the singleton, without using the
'release' method. A "cleanUpOurStuff" method that is called by the
app delegate upon quiting would handle this just fine.
_______________________________________________
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