iOS捕获系统异常
2015-09-17 10:32
399 查看
// 提交异常Log信息 void UncaughtExceptionHandler(NSException *exception) { // 异常Log信息 NSString *errorStr = [NSString stringWithFormat:@"错误详情:%@\n%@\n%@", [exception name], [exception reason], [[exception callStackSymbols] componentsJoinedByString:@"\n"]]; // 提交到服务器 NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:device_exception, Host]]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setRequestMethod:@"POST"]; [request setPostValue:errorStr forKey:@"exception"]; [request setPostValue:@"1" forKey:@"device"]; [request startSynchronous]; } // AppDelegate中调用 NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler); //设置异常Log信息的处理
相关文章推荐
- iOS 正则表达式使用详解
- ios 推送证书没有密钥 解决方案【转载】
- iOS 取相册
- ios 七牛云上传流程
- iOS--判断字符串NSString中数字、中文、大小写英文
- iOS夯实:RunLoop
- 在Android上山寨了一个Ios9的LivePhotos,放Github上了
- iOS学习——常用博客
- iOS 时间转换总结
- ios webView 加载本地html5
- iOS 9.0系统策略更新
- iOS - 强制旋转屏幕之代码实现
- iOS开发中最基本的位置功能实现示例
- iOS证书过期后,xcode打包ipa闪退。使用控制台方式来打包
- iOS CLLocationManager定位
- ios8.0下CLLocationManager定位服务需要授权了
- 【投稿】iOS 蓝牙开发(二)iOS 连接外设的代码实现
- iOS 中关于copy和mutable copy的理解
- iOS疯狂讲解之复杂对象的归档与反归档
- IOS定位服务的应用