title: UIPickerView animation glitch
body: <p>I have a problem with an effect I am trying to implement where a UIPickerView slides up when a button is pressed.</p>
  
  <pre><code>   -(IBAction)slideUp:(id)sender{
  if([sender currentTitle] == @"Select"){
  
  [pickerView setFrame: CGRectMake(0, 415.0, 320.0, 216.0)];
  [UIView beginAnimations: nil context: NULL];
  [UIView setAnimationDuration: 0.5];
  [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
  [pickerView setFrame: CGRectMake(0, 201.0, 320.0, 216.0)];
  [UIView commitAnimations];
  [slideButton setTitle:@"Done" forState:UIControlStateNormal];
  </code></pre>
  
  <p>}
  }</p>
  
  <p>As you can see, the code first checks if the button's title is "Select" or "Done", and if it is select it slides in the UIPickerView. However, every time I build the application, the first time you press the button, the UIPickerView immediately appears in the end position, and then slides out of view. The button title does not change. After this initial glitch, it works fine.</p>
  
  <p>If you know why this might be happening, or can think of a quick fix for it, I would really appreciate it.</p>
  
  <p>Luke</p>