POST

    //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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容