iOS每日一记之———————————————写给自己的......................

发送POST请求:

NSMutableDictionary *postDict = [[NSMutableDictionary alloc] init];
    postDict[@"uid"] = [SingleManager shareManager].uid;
    postDict[@"groupid"] = self.groupID;
    postDict[@"service"] = @"Group.delGroup";
    //解散群
    [self POST:@"Group.delGroup" parameters:postDict withMessage:@"正在加载" success:^(id responseObject) {
        if (responseObject) {
            NSDictionary *data = responseObject[@"data"];
            if ([data[@"code"] integerValue]==1){
                //创建群组成功
                [SVProgressHUD dismiss];
               [self.navigationController popToViewController:groupVC animated:YES];
                }else{
                
            }
        }
        
    }];

解析的时候 如果是字典就是说是一页显示的那种  就用

  _groupModel = [MyGroupModel mj_objectWithKeyValues:data[@"info"]];  创建一个model去接收就行了

                                                                                                                            字典数组 -> 模型数组

如果是tableView用来显示数据的也就是数组类型的   self.groupUserlistsArr = [SJZGroupUserlist mj_objectArrayWithKeyValuesArray:dic[@"groupUserlist"]];

创建一个数组去接收 这个模型数组

然后赋值就是了


重写模型的set方法进行赋值就是了 恩恩

-(void)setGroupDataModel:(SJZGroupDataModel *)groupDataModel{
    _groupDataModel =groupDataModel;
   [self.headImageView sd_setImageWithURL:[NSURL URLWithString:_groupDataModel.avatar] placeholderImage:[UIImage imageNamed:@"defaultImage.png"]];
    self.titleLabel.text = _groupDataModel.title;
    self.contnetLabel.text = _groupDataModel.message;
    NSString *timedata =[NSString stringWithFormat:@"%ld",(long)_groupDataModel.lastdateline];
    self.timeLabel.text = [[SingleManager shareManager]changeDateStrToDateStrWithInDateFormate:nil withOutFormate:@"MM-dd" withDateStr:nil withShiJianChuoStr:timedata withDate:nil];
    self.mouthLabel.text =[[SingleManager shareManager]changeDateStrToDateStrWithInDateFormate:nil withOutFormate:@"HH:mm" withDateStr:nil withShiJianChuoStr:timedata withDate:nil];
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值