程序异常退出时发送邮件!

void UncaughtExceptionHandler(NSException *exception) {
NSArray *arr = [exception callStackSymbols];
NSString *reason = [exception reason];
NSString *name = [exception name];
NSString *urlStr = [NSString stringWithFormat:@"mailto://suifeng_89@163.com?subject=bug报告&body=感谢您的配合!<br><br><br>"
"错误详情:<br>%@<br>--------------------------<br>%@<br>---------------------<br>%@",
name,reason,[arr componentsJoinedByString:@"<br>"]];
NSURL *url = [NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:url];
}

http://ityran.com/thread-117-1-1.html出处

posted @ 2011-09-27 16:38  痴人指路  阅读(213)  评论(0编辑  收藏  举报