title: How to update or reset a UIView with a custom subview?
body: <p>I have a UIView in a UIViewController to which I add a custom subview in the <code>viewDidAppear</code> method.</p>
  
  <pre><code>MyView *myView = [[MyView alloc] initWithLabelText:text];
  [self.view addSubview:myView];
  [myView release];
  </code></pre>
  
  <p>The <code>text</code> variable is a string used on a label in <code>myView</code>. This <code>text</code> changes every time you come back to the current view. But it seems that <code>viewDidAppear</code> does not reload the view - it rather loads a new view over the old one - so I have two labels over each other.</p>
  
  <p>I tried to use <code>viewWillAppear</code> but it doesn't make any difference. I also tried to use <code>[self.view setNeedsDisplay]</code> - doesn't help. I also tried to make <code>myView</code> an instance variable, but it also didn't help.</p>
  
  <p>What worked was to remove the view explicitly, when I declared it as an instance variable:</p>
  
  <pre><code>- (void)viewDidDisappear:(BOOL)animated
  {
      [_myView removeFromSuperview];
  }
  </code></pre>
  
  <p>Although there is this workaround I would like to simply reset the view when getting back to it. Does anybody know how to do that? I would appreciate it ;)</p>