Closed wangyu204 closed 4 years ago
现象:
基本上奔溃的都在如下地方 [manager.requestSerializer setValue:value forHTTPHeaderField:key];
我们是如下设置的:程序启动的时候调用如下方法
(void)startAvoidCrash{ //这句代码会让AvoidCrash生效,若没有如下代码,则AvoidCrash就不起作用 [AvoidCrash becomeEffective];
/*
//监听通知:AvoidCrashNotification, 获取AvoidCrash捕获的崩溃日志的详细信息 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil]; }
AFNetwork网络请求的时候,设置自定义header参数
(void)setHeaderParams:(NSDictionary)param withManager: (AFHTTPSessionManager )manager reuestMode:(NSString)mode { NSMutableDictionary dic = [NSMutableDictionary dictionaryWithDictionary:param]; //设置header参数 NSString key; NSString value;
key = guid_key; value = [HuConfigration getGuidKey]; if (value.length > 0) { [manager.requestSerializer setValue:value forHTTPHeaderField:key]; [dic setObject:value forKey:key]; } }
初步已经定位,是AFNetWorking第三方问题(用单例模式请求,AFNetWorking又比较老)。
现象:
基本上奔溃的都在如下地方 [manager.requestSerializer setValue:value forHTTPHeaderField:key];
我们是如下设置的:程序启动的时候调用如下方法
(void)startAvoidCrash{ //这句代码会让AvoidCrash生效,若没有如下代码,则AvoidCrash就不起作用 [AvoidCrash becomeEffective];
/*
//监听通知:AvoidCrashNotification, 获取AvoidCrash捕获的崩溃日志的详细信息 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dealwithCrashMessage:) name:AvoidCrashNotification object:nil]; }
AFNetwork网络请求的时候,设置自定义header参数
(void)setHeaderParams:(NSDictionary)param withManager: (AFHTTPSessionManager )manager reuestMode:(NSString)mode { NSMutableDictionary dic = [NSMutableDictionary dictionaryWithDictionary:param]; //设置header参数 NSString key; NSString value;
key = guid_key; value = [HuConfigration getGuidKey]; if (value.length > 0) { [manager.requestSerializer setValue:value forHTTPHeaderField:key]; [dic setObject:value forKey:key]; } }