• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: resetting ivars safely
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: resetting ivars safely
      • From: Daniel Child <email@hidden>
References: 
 >resetting ivars safely (From: Daniel Child <email@hidden>)

  • Prev by Date: Re: warning: type `string' has a user-defined constructor
  • Next by Date: Re: resetting ivars safely
  • Previous by thread: Re: resetting ivars safely
  • Next by thread: Re: resetting ivars safely
  • Index(es):
    • Date
    • Thread