title: newbie question on updating color on UIView
body: <p>I am using a UIView object that simply sets the background color to blue. This works fine the first time the code runs, but running the changeBackgroundColor mehod again (from a button action) doesnt change the color to red, even though debugging the code clearly shows the method runs as expected. </p>
  
  <p>Please could someone explain why the view color doesnt update? </p>
  
  <p>Header:</p>
  
  <pre><code>@interface colorClass : NSObject {  
      UIView *myView; 
  }
  
  @implementation
  ...
  -(UIView *)changeBackgroundColor {
  
      myView  = [[UIView alloc] initWithFrame:CGRectMake(100, 0, 500, 245)];
  
      static int counter = 1;
      if (counter++ %2){
          [mediaView setBackgroundColor:[UIColor blueColor]];
      }else {
          [mediaView setBackgroundColor:[UIColor redColor]];
  
      }
      return myView;
  }
  </code></pre>