How do I handle null values when decoding

I have made changes to my app and now I am receiving an error, “No value associated with key CodingKeys”. I have done some research and I am struggling with implementation to handle null values. Below is the code I am currently using and I am assuming the changes need to be applied to the “estimateLists = try decoder.decode([EstimateList].self, from: data)”.

Thank you in advance for your help!

    let path = dataFilePath()
    if let data = try? Data(contentsOf: path) {
        let decoder = PropertyListDecoder()
        do {
            estimateLists = try decoder.decode([EstimateList].self, from: data)
              }
     }

This topic was automatically closed after 166 days. New replies are no longer allowed.