如何在项目中将数据导入数组?

时间:2018-01-15 15:13:04

标签: swift

我收到以下错误:

  

无法下标类型' [[String:Any]]'索引为   键入'字符串'

以下是我的代码。

if let sPData =  self.actualityData(withIdentifier:"SHIPPING_TOTAL_SHIPPED") as? [String] {
  if sPData.count > 0 {
    if let content = self.content, let graph = content.childNode(withName:"graph") {
      let values = sPData.map { $0 ["total"] as! Int ?? 0}
      print(values)
      let lowest = values.min() ?? 0
      let highest = values.max() ?? 0
    }
  }
}

我在let值的行上收到此错误。

0 个答案:

没有答案