创建json文件 , 上传到阿里云
{
"data":[
{"lunbopic":"https://lyn326.oss-cn-beijing.aliyuncs.com/RedSquare/lunbo/shop1.jpeg"},
{"lunbopic":"https://lyn326.oss-cn-beijing.aliyuncs.com/RedSquare/lunbo/shop2.jpeg"},
{"lunbopic":"https://lyn326.oss-cn-beijing.aliyuncs.com/RedSquare/lunbo/shop3.jpeg"},
{"lunbopic":"https://lyn326.oss-cn-beijing.aliyuncs.com/RedSquare/lunbo/shop4.jpeg"}
]
}
解析
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/xml", nil];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
[manager GET:@"https://lyn326.oss-cn-beijing.aliyuncs.com/RedSquare/ShopZhongXin/ShopZhongXin.json" parameters:nil progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
NSLog(@"成功 : %@",responseObject);
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
NSLog(@"失败 : %@",error);
}];