第一种方法: [[UIApplication sharedApplication]
performSelector:@selector(suspend)];
第二种方法:
- (void)exitApplication {
AppDelegate *app = [UIApplication sharedApplication].delegate;
UIWindow *window = app.window;
[UIView animateWithDuration:1.0f animations:^{
window.alpha = 0;
} completion:^(BOOL finished) {
exit(0);//退出APP
}];
}
网友评论