[Solved] While decoding json from webservice, it shows an error: Could not cast value of type ‘__NSArrayM’ (0x10b84bdb0) to ‘NSDictionary’ (0x10b84c288)


Try this

var desriptionArray = [String]()

  for dataValues in responseObject["result"] as! [[String: AnyObject]]  {
      let name = dataValues ["description"] as! String
      desriptionArray .append(name)
   }

OR

for (index , element) in (responseObject["result"] as! [Any]).enumerated() {
                        let nameDict = element  as! [String : AnyObject]
                        let strDecription = nameDict["description"] as! String
                        desriptionArray .insert(strDecription, at: index)
                    }

solved While decoding json from webservice, it shows an error: Could not cast value of type ‘__NSArrayM’ (0x10b84bdb0) to ‘NSDictionary’ (0x10b84c288)