title: ViewWillDisappear versus dealloc
body: <p>I put an NSlog in my dealloc method of my view controller. It does not get consistently called. I do notice that ViewWillDisappear does get called always. Would it be ok to move all my tidy upcode here? Setting stuff to Nil and release calls. </p>
  
  <p>Anybody got some advice on why dealloc is not getting called? I know it says in docs it may not get called, but if you have a very simple App it gets called always. So something i do must be affecting the dealloc.</p>
  
  <p>This is the code that calls my ViewController than isnt always calling my dealloc.</p>
  
  <pre><code>-(IBAction) playComputerTapped:(id)sender
  {
  </code></pre>
  
  <p>PlayGameViewController *pgvc = [[PlayGameViewController alloc] 
          initWithNibName:@"PlayGameViewController" bundle:[NSBundle mainBundle]];
   pgvc.gameMode = 1; 
   [self presentModalViewController:pgvc animated:YES];
   [pgvc release];
      }</p>
  
  <p>The above code takes me from the mailmenu ViewController into the game.</p>
  
  <p>Below is the code to leave the gameViewController and take me back to the menu.</p>
  
  <pre><code>[self.parentViewController dismissModalViewControllerAnimated:YES];
  </code></pre>
  
  <p>Thanks
  -Code</p>