ios json解析3840错误
来源:互联网 发布:java数组的逆序输出 编辑:程序博客网 时间:2024/06/08 03:37
日志如下:
Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (JSON text did not start with array or object and option to allow fragments not set.) UserInfo=0x17066ad00 {NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}
后台数据不标准,检查后台数据是否错误,不是前端的事
完整代码如下:
NSDictionary *parameters; AlamofireRequest *fireRequest = [[AlamofireRequest alloc]init]; NSString *str = [fireRequest creatToken]; NSLog(@"%@",str); parameters =@{@"paraToken":str}; NSString *urlStr=[NSString stringWithFormat:@"http://130.55.225.204:81/smw/neeryProList"]; AFHTTPSessionManager *manager =[AFHTTPSessionManager manager]; manager.responseSerializer = [AFHTTPResponseSerializer serializer]; [manager GET:urlStr parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) { NSJSONSerialization *json = [NSJSONSerialization JSONObjectWithData:responseObject options:nil error:nil]; NSLog(@"!!!!!!!!!!!!!!!!!!!!! %@",json); NSDictionary *dic = json; NSLog(@"%@",dic[@"productList"]); for (NSDictionary *d in dic[@"productList"]) { ProdectModel *model= [[ProdectModel alloc]init]; model.productId = d[@"id"]; model.name = d[@"n"]; model.desc = d[@"d"]; model.price = d[@"p"]; model.coins = d[@"co"]; [self.productModelArray addObject:model]; } [self creatTableView]; } failure:^(NSURLSessionDataTask *task, NSError *error) { NSLog(@"`````%@",error); }];
0 0
- ios json解析3840错误
- IOS解析JSON数据格式错误一
- iOS:后台返回json数据格式错误无法解析
- json解析出现错误
- json解析错误
- ios 解析json
- iOS 解析json
- IOS解析Json数据
- IOS JSON详细解析
- iOS JSON解析
- iOS JSON解析
- IOS解析JSON
- IOS解析JSON
- IOS:JSON解析
- [ios]xml, json解析
- IOS-----> Json数据解析
- IOS解析JSON
- iOS中的JSON解析
- 自己写的LinkList
- 简单的gson对boolean转换的test(作为备注)
- 【HDU】1159 - Common Subsequence(LCS)
- git add , git commit 添加错文件 撤销
- Simple Line Editor----CSU 1019
- ios json解析3840错误
- 源码角度解析:StringBuffer、StringBuilder、String
- iTween
- POJ 2031 (最小生成树)
- Ubuntu下编译Android版本的ffmepg so库及源码
- UVALive5198 UVA512 Spreadsheet Tracking
- poj 3281
- ubuntu16.04登录界面输入用户名密码后又回到登录界面
- QQ聊天列表粘性控件