AFN抛出error,过去error里返回的数据。

       NSData *receiveData =error.userInfo[@"com.alamofire.serialization.response.error.data"];
        NSString *receiveStr = [[NSString alloc]initWithData:receiveData encoding:NSUTF8StringEncoding];
       //   字符串再生成NSData
        
        NSData * data = [receiveStr dataUsingEncoding:NSUTF8StringEncoding];
        
      //  再解析
        
        NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:nil];
        NSLog(@"q请求失败operation----%@",dict );

 
posted @ 2015-11-09 12:36  沧海小鱼儿  阅读(353)  评论(0编辑  收藏  举报