通过代码退出IOS程序

-(void) tapClick:(UITapGestureRecognizer *)tap{
    [UIViewbeginAnimations:@"exitApplication"context:nil];
    [UIViewsetAnimationDuration:0.5];
    [UIViewsetAnimationDelegate:self];
     [UIViewsetAnimationTransition:UIViewAnimationCurveEaseOutforView:self.view.windowcache:NO];
    [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
    //self.view.window.bounds = CGRectMake(0, 0, 0, 0);
    self.view.window.bounds = CGRectMake(0, 0, 0, 0);
    [UIViewcommitAnimations];
}
- (void)animationFinished:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context {
    if ([animationID compare:@"exitApplication"] == 0) {
        exit(0);
    }
}

 

posted on 2014-03-24 13:00  压力无限大  阅读(561)  评论(1编辑  收藏  举报

导航