美文网首页iOS审核上架
iOS post传数组参数

iOS post传数组参数

作者: iOS菜鸟攻城狮 | 来源:发表于2017-11-23 10:18 被阅读76次

    //拼接字符数组

    NSMutableString *ids = [NSMutableString stringWithString:@"["];

    for(ConsultationAppointmentDoctorDto *consulDoctor in self.consulAppointDto.doctors){

    [ids appendFormat:@"'%@',",consulDoctor.doctor.id_a];

    }

    NSString *idStr = [NSString stringWithFormat:@"%@]",[ids   substringWithRange:NSMakeRange(0,[ids length]-1)]];

    //核心代码

    NSMutableDictionary *paramsDict=[[NSMutableDictionary alloc] init];

    [paramsDict setObject:idStr forKey:@"doctorIds"];//将字符数组装入参数字典中

    相关文章

      网友评论

        本文标题:iOS post传数组参数

        本文链接:https://www.haomeiwen.com/subject/uznavxtx.html