I am having an issue with Serialization Json data. The error I receive is
“Could not cast value of type ‘__NSSingleEntryDictionaryI’ (0x7fff87c50e30) to ‘NSArray’ (0x7fff87c51fb0).”
This is the line it’s breaking on
-
Here is my web service. https://calc.refloor.com/service.php that returns the following
-
data = {“ProductLines”:[{“Name”:“Econoline”,“Description”:“TRADITIONAL”},{“Name”: “Standard”,“Description”: “VINYL PLANK”},{“Name”: “Smart Choice”,“Description”: “LIFETIME VINYL”},{“Name”: “Premium”,“Description”: “ENGINEERED VINYL”}]}
-
let jsonArray = try JSONSerialization.jsonObject(with: data, options:) as! [ Any ]
When I remove “ProductLines” key I do not run into this issue.