在swift

时间:2017-11-30 10:08:10

标签: ios json swift xcode

这是我从服务器获得的json我试图为这个json创建一个数据模型,但由于嵌套数组没有成功。任何人都可以帮助在swift中为这个jsonfile创建数据模型。如果你需要我可以提供我为这个json创建的数据模型,但这不起作用

{
  "result": [
    {
      "loo_id": null,
      "loo_name": null,
      "loo_address": null,
      "loo_image": null,
      "price": null,
      "loo_location": null,
      "type": null,
      "category": [
        {
          "category_id": "1",
          "category_name": "Hotel",
          "cat_enable_image": "****images/category/hotel_clr.png",
          "cat_disable_image": "****images/category/hotel_gry.png",
          "status": "0"
        },

        {
          "category_id": "5",
          "category_name": "Shopping Mall",
          "cat_enable_image": "****images/category/shopping_mall_clr.png",
          "cat_disable_image": "****images/category/shopping_mall_gry.png",
          "status": "0"
        }
      ],
      "days": null,
      "timings": null,
      "facilities": [
        {
          "facility_category_id": "1",
          "facility_category_name": "Male",
          "facility_category_enable_image": "****images/facility_category/male_clr.png",
          "facility_category_disable_image": "****images/facility_category/male_gry.png",
          "status": "0",
          "facility": [
            {
              "facility_id": "1",
              "facility_name": "Toiletten",
              "enable_image": "****images/facilities/toilet_color.png",
              "disable_image": "****images/facilities/toilet_grey.png",
              "count": "0",
              "status": "0"
            },
            {
              "facility_id": "2",
              "facility_name": "Lavatory",
              "enable_image": "****images/facilities/lavatory_color.png",
              "disable_image": "****images/facilities/lavatory_grey.png",
              "count": "0",
              "status": "0"
            },
            {
              "facility_id": "3",
              "facility_name": "Urinals",
              "enable_image": "****images/facilities/urinals_color.png",
              "disable_image": "****images/facilities/urinals_grey.png",
              "count": "0",
              "status": "0"
            },
            {
              "facility_id": "4",
              "facility_name": "Shower",
              "enable_image": "****images/facilities/shower_color.png",
              "disable_image": "****images/facilities/shower_grey.png",
              "count": "0",
              "status": "0"
            },
            {
              "facility_id": "5",
              "facility_name": "Standing Toilet",
              "enable_image": "****images/facilities/standing_toilet_color.png",
              "disable_image": "****images/facilities/standing_toilet_grey.png",
              "count": "0",
              "status": "0"
            }
          ]
        },
         {
          "facility_category_id": "4",
          "facility_category_name": "Wheelchair",
          "facility_category_enable_image": "****images/facility_category/1771138800.png",
          "facility_category_disable_image": "****images/facility_category/1790222751.png",
          "status": "0",
          "facility": [
            {
              "facility_id": "12",
              "facility_name": "Toiletten",
              "enable_image": "****images/facilities/toilet_color.png",
              "disable_image": "****images/facilities/toilet_grey.png",
              "count": "0",
              "status": "0"
            },
            {
              "facility_id": "13",
              "facility_name": "Lavatory",
              "enable_image": "****images/facilities/lavatory_color.png",
              "disable_image": "****images/facilities/lavatory_grey.png",
              "count": "0",
              "status": "0"
            },
            {
              "facility_id": "14",
              "facility_name": "Shower",
              "enable_image": "****images/facilities/shower_color.png",
              "disable_image": "****images/facilities/shower_grey.png",
              "count": "0",
              "status": "0"
            }
          ]
        }
      ],
      "accessbility": [
        {
          "accessbility_id": "1",
          "accessbility_name": "Wheelchair",
          "accessbility_enable_image": "****images/accessbility/wheelchair_clr.png",
          "accessbility_disable_image": "****images/accessbility/wheelchair_gry.png",
          "status": "0"
        },
        {
          "accessbility_id": "2",
          "accessbility_name": "Car Access",
          "accessbility_enable_image": "****images/accessbility/car_access_clr.png",
          "accessbility_disable_image": "****images/accessbility/car_access_gry.png",
          "status": "0"
        }
      ],
      "terms_conditions": null
    }
  ]
}

0 个答案:

没有答案