/** 让程序崩溃但是不闪退的方法 */
void handException(NSException * exception){
/** 弹出提示框 */
UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"title" message:@"message" delegate:nil cancelButtonTitle:@"cancel" otherButtonTitles:@"titles", nil];
[alert show];
/** 重新启动 runloop */
[[NSRunLoop currentRunLoop]addPort:[NSPort port] forMode:NSDefaultRunLoopMode];
[[NSRunLoop currentRunLoop]run];
NSLog(@"---runloop 完成----");
}
/** 程序从杀死到接收到消息打开通知的操作 */
- (void)DYApplication:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSSetUncaughtExceptionHandler(handException);
}