title: Subview management within master/detail view in iOS (with ARC)
body: <p>I have a master-detail controller for my app.  The master controller is a UITabBarController and each tab is a UITableViewController that contains different types of data.</p>
  
  <p>I plan on having a main header / image on the main detail view but then need to add different subviews to the main detail view to detail specific information depending on which tab I am using.</p>
  
  <p>I am currently adding the relevant subview in my </p>
  
  <p><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath</code></p>
  
  <p>Function like so:</p>
  
  <pre><code>UIViewController *subview = [[UIViewController alloc] initWithNibName:@"ItemNotFoundViewController" bundle:nil];
  subview.view.frame = CGRectMake(20, 160, subview.view.frame.size.width, subview.view.frame.size.height);  
  [self.detailViewController.view addSubview:subview.view];
  </code></pre>
  
  <p>However, I believe that this is a poor way of doing things - every time someone clicks on a table cell another subview will be thrown on top of the stack of previously added subviews, creating memory issues.</p>
  
  <p>What I am wondering is, does ARC take care of this for me?  Is my approach passable?  and even if it is passable, is there a better way of doing this?</p>