Search code examples
iphone-sdk-3.0uikituiviewinterface-buildercore-animation

Core Animation question about swapping views


-(IBAction)buttonPressed1:(id)sender 
{
SignView *tempVC = [[SignView alloc] initWithNibName:@"SignView" bundle:Nil];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationTransition: UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[UIView setAnimationDelay:0.0f];
[UIView setAnimationDuration:0.2f];
[self presentModalViewController:tempVC animated:YES];
[tempVC passDataWithString:button1.titleLabel.text andColor:currentlySelectedColor isNightModeOn:nightMode.on];
[UIView commitAnimations];
} 

can anyone help me figure out why this code doesn't work?


Solution

  • This method will call beginAnimations: and commitAnimations, which cannot be nested.

    [self presentModalViewController:tempVC animated:YES];
    

    So move it to before beginAnimations: or after commitAnimations.