ios 点击退出程序方法
Posted fei619730
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ios 点击退出程序方法相关的知识,希望对你有一定的参考价值。
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [delegate exitApplication];
- ( void )exitApplication
[ UIView beginAnimations : @"exitApplication" context : nil ];
[ UIView setAnimationDuration : 0.5 ];
[ UIView setAnimationDelegate : self ];
// [UIView setAnimationTransition:UIViewAnimationCurveEaseOut forView:self.view.window cache:NO];
[ UIView setAnimationTransition : UIViewAnimationCurveEaseOut forView : self . window cache : NO ];
[ UIView setAnimationDidStopSelector : @selector (animationFinished:finished:context:)];
//self.view.window.bounds = CGRectMake(0, 0, 0, 0);
self . window . bounds = CGRectMake ( 0 , 0 , 0 , 0 );
[ UIView commitAnimations ];
- ( void )animationFinished:( NSString *)animationID finished:( NSNumber *)finished context:( void *)context
if ([animationID compare : @"exitApplication" ] == 0 )
exit ( 0 );
以上是关于ios 点击退出程序方法的主要内容,如果未能解决你的问题,请参考以下文章
iOS,先强制退出应用,点击接收通知banner后,应用启动失败