Getting Crash - “Could not cast value of type 'NSTaggedPointerString' (0x10ec9b560) to 'NSDictionary' (0x10ec9b880)”

47 Views Asked by At

Am getting crash for data type conversion mismatch. how to change data type in swift to rectify this issue?

var Createsections: [[String:Any]] = [[String:Any]]()
var TableData: [[String:Any]]   = [[String:Any]]()

for item in TableData {

 if let subcategories = item["subcategories"] as? [Any] {

    for item_list in subcategories {

             // item_list contain string value - Household
     Createsections.append(item_list as! [String: Any])// this line crash for me.
   }

} }

I want to append that String Value into Createsections.

0

There are 0 best solutions below