I have the following code to do a UIView animation:
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:mapView.view cache:NO];
[self addSubview:detailView];
[mapView removeFromSuperview];
[UIView commitAnimations];
It works when I dont add the detailView. What actually happens is the equivalent of this:
[self addSubview:detailView];
[mapView removeFromSuperview];