Iphone 为什么我的翻转动画没有更改为其他视图?

Iphone 为什么我的翻转动画没有更改为其他视图?,iphone,ios5,xcode4.3,Iphone,Ios5,Xcode4.3,这是我的翻转动画代码,我使用两个视图,即viewMain和viewStart - (IBAction)readyBtn:(id)sender { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view

这是我的翻转动画代码,我使用两个视图,即viewMain和viewStart

- (IBAction)readyBtn:(id)sender {
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:[self view] cache:YES];
    [[self view] addSubview:viewStart];
    [UIView commitAnimations];
}

- (IBAction)startBtn:(id)sender {
    [UIView beginAnimations:nil context:nil];
    [UIView setAnimationDuration:1.0];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:[self view] cache:YES];
    [viewStart removeFromSuperview];
    [UIView commitAnimations];
}

运行后,我的viewMain将翻转到同一个viewMain,它无法将翻转更改为viewStart。如何修复它?

但是为什么我的viewStart会在我的viewMain完成翻转后显示?很奇怪
(IBAction)readyBtn:(id)sender {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:viewMain cache:YES];
    viewStart.frame = viewMain.bounds;
    [viewMain addSubview:viewStart];
    [UIView commitAnimations];