NSDictionary * errorInfo = error.userInfo;
if ([[errorInfo allKeys] containsObject: @"com.alamofire.serialization.response.error.data"]){
NSData * errorData = errorInfo[@"com.alamofire.serialization.response.error.data"];
NSDictionary * errorDict = [NSJSONSerialization JSONObjectWithData: errorData options:NSJSONReadingAllowFragments error:nil];
NSNumber * errorCodeNum = errorDict[@"err_code"];
NSLog(@"=====%@====", errorCodeNum);
}
NSError 解析
最新推荐文章于 2023-04-17 22:09:46 发布