In my iPhone app there is a window that appears over the main window. Here is the code for my close button;
-(IBAction)cancel{
[UIView beginAnimations:@"Animation" context:nil];
[UIView setAnimationDuration:0.75];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES];
[self.view removeFromSuperview];
//[_window addSubview:view2];
[UIView commitAnimations];}
The window closes correctly but the animation will not execute. I do not understand why.
thanks
I think it is because you are removing the view from the superview during the animation. The animation does not occur because the view is gone. You should wait until after the animation finishes to remove to view, which you can do by setting a delegate and selector which is called when the animation is finished.
And then in