title: Dealloc method of UIView subclass not getting called
body: <p>I have a view controller named SettingsViewController, and a custom UIView subclass named ViewAccounts. In SettingsViewController, I am using the code below to add ViewAccounts view into SettingsViewController. </p>
  
  <pre><code> if(!self.viewAccounts)
   {
        ViewAccounts *objViewAccounts= [[ViewAccounts alloc] initWithFrame:CGRectMake(0, yViews, 320, 400) withViewController:self];
        [self.view insertSubview:objViewAccounts atIndex:0];
        self.viewAccounts = objViewAccounts;
        [objViewAccounts release];
  }
  </code></pre>
  
  <p>The Problem is that the dealloc method of  ViewAccounts (subclass of UIView) is not getting called. If I comment these both lines of code, then dealloc method gets called.</p>
  
  <pre><code>[self.view insertSubview:objViewAccounts atIndex:0];
  self.viewAccounts = objViewAccounts;
  </code></pre>
  
  <p>I guess the problem is  with retain count, at it gets incremented by 1 when we use insertSubview or addSubiew, but how to get rid of it. Is this the right approach to use it?</p>