Re: Multiple singletons
Re: Multiple singletons
- Subject: Re: Multiple singletons
- From: Ondra Cada <email@hidden>
- Date: Mon, 27 Jun 2005 23:16:19 +0200
On 27.6.2005, at 21:55, Daniel Jalkut wrote:
One thing worth noting with regard to singletons: always use a
"static global" for the singleton variable
Definitely. Whenever possible (ie., not accessed from more methods),
it's cleaner to declare the variable inside a method anyway:
+(X*)singleton {
static X *singleton=nil;
if (!singleton) ... yadda yadda yadda
}
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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