title: How to create the model class for the following JSON data and parse it?
body: <p>My JSON data</p>
  
  <pre><code>{
   "addon_items" : [
                       {
                        "aname" : "",
                        "id" : "2588",
                        "name" : "Plain Nan",
                        "order" : "1",
                        "aid" : "259",
                        "Sub_Add_Items" : "",
                        "icon" : "",
                        "status" : "1",
                        "next" : "0",
                        "price" : "0.60"
                       },
                       {
                        "aname" : "",
                        "id" : "2589",
                        "name" : "Pitta Bread",
                        "order" : "2",
                        "aid" : "259",
                        "Sub_Add_Items" : "",
                        "icon" : "",
                        "status" : "1",
                        "next" : "0",
                        "price" : "0.00"
                      }
  
                     ],
  
   "addon" : {
               "description" : "Please choose your Nan bread",
               "aname" : "",
               "id" : "259",
               "icon" : "",
               "limit" : "1",
               "special_addon" : "",
               "next" : "165"
             }
   }
  </code></pre>
  
  <p>I created three class models named AddOnResponse, AddOn, AddOnItems like this:</p>
  
  <p><strong>AddOnResponse class model</strong></p>
  
  <pre><code>class AddOnResponse {
  
  var addon: Array&lt;String&gt;?
  var addonitems: Array&lt;AnyObject&gt;?
  
  init(addon:Array&lt;String&gt;?,addonitems: Array&lt;AnyObject&gt;?){
      self.addon = addon
      self.addonitems = addonitems
   }
  }
  </code></pre>
  
  <p><strong>AddOn class model</strong></p>
  
  <pre><code>class AddOn {
  
  
  var id: Int?
  var icon: String?
  var desc: String?
  var limit: Int?
  var next: Int?
  var aname: String?
  var specialaddon: Int?
  
  init(id: Int?,icon: String?,desc: String?,limit: Int?,next: Int?,aname: String?,specialaddon: Int?){
  
      self.id = id
      self.icon = icon
      self.desc = desc
      self.limit = limit
      self.next = next
      self.aname = aname
      self.specialaddon = specialaddon
  
    }
   }
  </code></pre>
  
  <p><strong>AddOnItems class model</strong></p>
  
  <pre><code>class AddOnItems {
  
  
  var id: Int?
  var aid: Int?
  var name: String?
  var price: Int?
  var order: Int?
  var status: Int?
  var next: Int?
  var aname: String?
  var subaddItems: Int?
  var icon: String?
  
  init(id: Int?,aid: Int?,name: String?,price: Int?,order: Int?,status: Int?,next: Int?,aname: String?,subaddItems: Int?,icon: String?){
      self.id = id
      self.aid = aid
      self.name = name
      self.price = price
      self.order = order
      self.status = status
      self.next = next
      self.aname = aname
      self.subaddItems = subaddItems
      self.icon = icon
     }
   }
  </code></pre>
  
  <p>Now I am fetching my JSON data using Alamofire but when accepting dat into class model using object I am getting nil value.</p>
  
  <pre><code>    var addonResponses = [AddOnResponse]()
  
      Alamofire.request(.GET, myAddOnUrl)
          .validate()
          .responseJSON
          {   response in
              switch response.result
              {
              case .Success:
                  if let value = response.result.value{
                      let json = JSON(value)
                      print(json)
                      print(json["addon"].arrayValue)
  
  
             for(_,content) in json{
                 let addOnRes = AddOnResponse(addon:content["addon"].arrayValue,
                                 addonitems:content["addon_items"].Arrayobject)
  
                          print(self.addonResponses.count)
                          print(addOnRes.addon)
                          print(addOnRes.addonitems)
                      }
                  }
  </code></pre>
  
  <p>The addon and addonitems data are coming nil, why?           </p>