I've run into a problem, and I can not find a solution.
I have an array where I store the start x and end x locations of different objects
placedArray : [[String: [Int: [String: String]]]]
placedArray = [["auto": [0: ["x-start": "300", "x-end": "400"]]], ["bus": [0: ["x-start": "0", "x-end": "300"]]]]
I want to add one more auto to the list, so what I try to do is:
placedArray["auto"].append([1: ["x-start": "400", "x-end": "500"]])
Error:
Cannot subscript a value of type '[[String : [Int : [String : String]]]]' with an index of type 'String'
I would like to get at the end
placedArray = [["auto": [0: ["x-start": "300", "x-end": "400"], 1: ["x-start": "300", "x-end": "400"]]], ["bus": [0: ["x-start": "0", "x-end": "300"]]]]
structor aclassinstead of shoving everything into a dictionary