美文网首页
二维数组解析

二维数组解析

作者: Qy_iOS | 来源:发表于2020-09-01 15:43 被阅读0次

    第一个model

    +(NSMutableArray *)categoryGoodsList:(NSArray *)listArr{

        NSMutableArray *nsArr = [[NSMutableArray alloc] init];

        if([listArrisEqual:@""]) {

        }else{

            for(NSDictionary*listDicinlistArr) {

                ShopCategoryGoodsModel *model = [[ShopCategoryGoodsModel alloc] init];

                [modelsetValuesForKeysWithDictionary:listDic];

                NSMutableArray*listArr = [[NSMutableArrayalloc]init];

                for(NSDictionary*listDicinmodel.tertiaryCategories) {

                    ShopCategorySecondModel *scModel = [[ShopCategorySecondModel alloc] init];

                    scModel = [ShopCategorySecondModeltertiaryCategories:listDic];

                    [listArraddObject:scModel];

                }

                model.tertiaryCategories= listArr;

                [nsArraddObject:model];

            }

        }

        returnnsArr;

    }

    第二个model

    +(ShopCategorySecondModel *)tertiaryCategories:(NSDictionary *)dic

    {

        ShopCategorySecondModel *model = [[ShopCategorySecondModel alloc] init];

        [modelsetValuesForKeysWithDictionary:dic];

        returnmodel;

    }

    赋值

        CategoryListModel*listModel =_secondGoodsArr[section];

        return listModel.tertiaryCategories.count;

    相关文章

      网友评论

          本文标题:二维数组解析

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