title: How to dealloc a singleton?
body: <p>I have a class named 'Capture' that is a subclass of NSObject and it also adds views to a superview.</p>
  
  <p>I have added a Settings.bundle which consists of slider. When the slider value is 'ON/1' I show the views in 'Capture' in the main window as subview. When the slider value is 'OFF/0' I have to remove the view added from 'Capture' and release all the objects present in 'Capture'.</p>
  
  <p>I simply don't want to hide the views created by 'Capture' class on to the main view, when the slider value is 'OFF/0'. </p>
  
  <p>I want to dealloc the 'Capture' when the app in sent to background and not when the app terminates, so i cannot use the notification UIApplicationWillTerminateNotification to dealloc a singleton.</p>
  
  <p>If i just hide the views displayed by 'Capture', there will be unnecessary use of memory for the 'Capture' class</p>
  
  <p>So now how do i dealloc a singleton.</p>
  
  <p>'Capture' class views will be on top of every view controller, even when the events occurs.
  It is allocated once by class method called in AppDelegate.</p>
  
  <p>singleton is created this way:</p>
  
  <pre><code>static ScreenCapture *sharedScreen = nil;
  
  +(Capture *)sharedScreenCapture
  {
      if (!sharedScreen) 
      {
          sharedScreen = [[Capture alloc] init];
      }
      return sharedScreen;
  }
  </code></pre>