Re: Proper way to create a singleton without @synchronized ?
Re: Proper way to create a singleton without @synchronized ?
- Subject: Re: Proper way to create a singleton without @synchronized ?
- From: Joanna Carter <email@hidden>
- Date: Sun, 17 Apr 2011 19:52:11 +0100
Hi guys
> That's only because, unlike java, obj-c doesn't have a way built into the language to enforce a class to be abstract. I can see valid reasons to subclass a singleton if that singleton is to be used as an abstract class and never be instantiated by itself.
Tell me; maybe it's my background in other languages, but I would tend to use a "static class" as a singleton; or, at least, design a class with only class methods/properties, with static "fields" declared in the @implementation section of a class.
Why this fascination with going to all the trouble of creating a singleton rather than using the "static class" approach?
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden