title: Possible to set singleton back to nil?
body: <p>I have implemented a singleton object using the regular pattern. My question is: is it possible to set this object back to nil, so that on a later called to [MySingleton sharedInstance] the object gets re-initialised? </p>
  
  <pre><code>// Get the shared instance and create it if necessary.
  + (MySingleton *)sharedInstance {
  
      static dispatch_once_t pred;
      static MySingleton *shared = nil;
      dispatch_once(&amp;pred, ^{
          shared = [[MySingleton alloc] init];
      });
      return shared;
  }
  
  // We can still have a regular init method, that will get called the first time the     Singleton is used.
  - (id)init 
  {
      self = [super init];
  
      if (self) {
      // Work your initialising magic here as you normally would
  
      }
      return self;
  }
  </code></pre>
  
  <p>My guess is that </p>
  
  <pre><code>MySingleton *shared = [MySingleton sharedInstance];
  shared = nil;
  </code></pre>
  
  <p>only sets the local pointer <code>shared</code> to <code>nil</code>. After all, <code>shared</code> is declared as <code>static</code>.</p>