-(void)animationFinished:(NSString*)animationid finished:(NSNumber*)finished
context:(void*)context
{
if ([animationid compare:@"exitApplication"]==0) {
exit(0);// 退出应用程序
NSLog(@"stop");
}
}
-(IBAction)exit:(id)sender
{
[UIViewbeginAnimations:@"exitApplication"context:nil]; //动画名称
[UIViewsetAnimationDuration:6];
[UIViewsetAnimationDelegate:self];
[UIViewsetAnimationTransition:UIViewAnimationCurveEaseInOutforView:self.viewcache:NO]; // 动画方式
//动画结束执行的操作
[UIVie setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
self.view.bounds=CGRectMake(0,0, 0, 0);//动画结束
[UIViewcommitAnimations];
}