Swift 3 Type 'Any' has no subscript members
问题 I just converted my project to Swift 3 I have this line of code here: let type = self.data[indexPath.row]["Type"] as? String but now I get this error: Type 'Any' has no subscript members Why am I getting this error and do I fix it? 回答1: let type = (self.data[indexPath.row] as? [String : String])?["Type"] You need to cast self.data[indexPath.row] to a dictionary. 回答2: Either your data or the value returned when you subscript it, e.g. data[0] has the Any type, which you're trying to subscript.