Re: resetting ivars safely
Re: resetting ivars safely
- Subject: Re: resetting ivars safely
- From: Chris Hanson <email@hidden>
- Date: Wed, 12 Sep 2007 14:48:17 -0700
On Sep 12, 2007, at 1:59 PM, Daniel Child wrote:
I am trying to find a way to safely reset or reinitialize the
instance variables of a singleton object.
If you feel a need to do this, should it really be a singleton?
Very few objects should be singletons. Even for true singletons, it's
almost always better to make them normal, separately-instantiable
objects -- it makes writing the unit tests that specify their behavior
much, much easier -- and only have a "default" or "shared" instance as
a convenience.
-- Chris
_______________________________________________
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