我刚刚将我的项目转换为Swift 3我在这里有这行代码:
let type = self.data[indexPath.row]["Type"] as? String
Run Code Online (Sandbox Code Playgroud)
但现在我收到这个错误:
Type 'Any' has no subscript members
Run Code Online (Sandbox Code Playgroud)
为什么我会收到此错误并修复它?
ego*_*dan 16
let type = (self.data[indexPath.row] as? [String : String])?["Type"]
Run Code Online (Sandbox Code Playgroud)
你需要转换self.data[indexPath.row]
成字典.
归档时间: |
|
查看次数: |
14437 次 |
最近记录: |