zoukankan      html  css  js  c++  java
  • iOS上传Crash日志

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        // Override point for customization after application launch.
        NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);
        return YES;
    }
     
    void UncaughtExceptionHandler(NSException *exception) {
        /**
         *  获取异常崩溃信息
         */
        NSArray *callStack = [exception callStackSymbols];
        NSString *reason = [exception reason];
        NSString *name = [exception name];
        NSString *content = [NSString stringWithFormat:@"========异常错误报告======== name:%@ reason: %@ callStackSymbols: %@",name,reason,[callStack componentsJoinedByString:@" "]];
     
        /**
         *  把异常崩溃信息发送至开发者邮件
         */
        NSMutableString *mailUrl = [NSMutableString string];
        [mailUrl appendString:@"mailto:test@qq.com"];
        [mailUrl appendString:@"?subject=程序异常崩溃,请配合发送异常报告,谢谢合作!"];
        [mailUrl appendFormat:@"&body=%@", content];
        // 打开地址
        NSString *mailPath = [mailUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailPath]];
    }
  • 相关阅读:
    连通域标记
    qt&gdal
    gdal vs2013编译
    java配置
    windows下面安装Python和pip
    mfc operator new”: 没有重载函数接受 3 个参数
    std::min&std::max与mfc冲突问题
    qt中vtk易出现错误
    cmake构建qt工程
    Webstorm补丁
  • 原文地址:https://www.cnblogs.com/liaods/p/5412557.html
Copyright © 2011-2022 走看看