解决AFNetWorking 网络请求,报警告Incorrect
2017-04-20 本文已影响0人
铁臂小肆
在App进行网络请求的时候,后台老是打印
Incorrect NSStringEncoding value 0x8000100 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future.
只需要对进行请求的Url地址做一次转码即可解决,如下:
+ (NSString *_Nullable) encodeURL:(NSString*_Nullable) dString {
NSString *encodedString = (NSString *)
CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)dString,
NULL,
nil,
kCFStringEncodingUTF8));
return encodedString;}