title: iphone xcode; releasing a view instance crashing the table with datasource
body: <p>My code crashes with a bad access, when i have a view with tables. I have figured what the problem is, but looking for the right solution.</p>
  
  <p>In View 1 - i have a button that creates and instance of view 2 and then releases it, something like this:</p>
  
  <pre><code>  settingsScreen *settings = [[settingsScreen alloc] initWithNibName:@"settingsScreen" bundle:nil];
    CGRect theFrame = settings.view.frame;
    //theFrame.origin = CGPointMake(self.view.frame.size.width, 0);
    theFrame.origin = CGPointMake(0,-(self.view.frame.size.height));
    settings.view.frame = theFrame;
    theFrame.origin = CGPointMake(0,0);
    [UIView beginAnimations:nil context:nil]; 
    [UIView setAnimationDuration:0.8f];
    settings.view.frame = theFrame;
    [UIView commitAnimations];
    [self.view addSubview:settings.view];
    [settings release];
  </code></pre>
  
  <p>In view 2 there is table, where i am setting the datasource and delegate to self on viewDidLoad, but this crashes the app with exec_bad_access</p>
  
  <p>If i remove [settings release] in View 1, everything is fine. </p>
  
  <p>If i do not release the view, is'nt it wrong to leave it in the memory?</p>
  
  <p>how can i get over this situation?</p>
  
  <p>Thanks</p>