//POSt
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
NSString *strURL = @"http://api.izhangchu.com";
NSDictionary * dic = @{@"methodName": @"HomeSerial", @"serial_id": @(1), @"size": @"20"};
[managerPOST:strURLparameters:dicprogress:^(NSProgress*_NonnulluploadProgress) {
}success:^(NSURLSessionDataTask*_Nonnulltask,id _NullableresponseObject) {
NSLog(@"%@",responseObject);
[DataModelTwo mj_setupObjectClassInArray:^NSDictionary *{
return@{
@"data":@"DataModelThree"
};
}];
self.dataModel= [DataModelmj_objectWithKeyValues:responseObject];
// NSLog(@"dsds");
[self.tableViewreloadData];
}failure:^(NSURLSessionDataTask*_Nullabletask,NSError*_Nonnullerror) {
NSLog(@"%@",error);
}]
-(NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section{
return self.dataModel.data.data.count;
}
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath{
staticNSString*string =@"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:string];
if(!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:string];
}
DataModelThree*three =self.dataModel.data.data[indexPath.row];
cell.textLabel.text= three.title;
returncell;
}
#import "DataModelTwo.h"
NS_ASSUME_NONNULL_BEGIN
@interfaceDataModel :NSObject
@property (nonatomic , strong)DataModelTwo *data;
@end