title: Xcode hide self created button
body: <p>I created a button programmatically: </p>
  
  <pre><code>UIButton *myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
  myButton.frame = CGRectMake(290, 120, 40,20); // position in the parent view and set the size of the button
  [myButton setTitle:@"Back" forState:UIControlStateNormal];
  // add targets and actions
  [myButton addTarget:self action:@selector(backLogin:) forControlEvents:UIControlEventTouchUpInside]; 
  // add to a view
  [myButton setAlpha:0];
  [self.view addSubview:myButton];    
  </code></pre>
  
  <p>Now I would like to hide this button again using another method and use animation to make the button fade away (!). 
  Obviously, I cannot use the variable myButton again and I don't want to make the variable global. Removing the Subview from the layer won't animate I guess. Do you have an idea? I can't make it to work... Thanks! </p>