将我当前的Xcode(v 7.0.1)项目迁移到Xcode 7.1.1时出现以下错误
知道如何解决上述错误吗?
我的代码如下
var arrOfRewardDetail : Array = [Dictionary<String, String>]()
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return arrOfRewardDetail.count //Ambiguous reference to member 'count'
}
if self.arrOfRewardDetail[indexPath.row]["KEY"] == "Promotion By : "{} // Cannot subscript a value of type 'Array'
更新现在收到以下错误
let indexOfEnum : Int = self.arrPromitionDetailEnum.indexOf(dictRewardInfo["r_promotion_detail_type"]!)!
let indexOfEnum : Int = self.arrPromitionDetailEnum.indexOf(dictInfo["r_promotion_detail_type"]!)! // Cannot subscript a value of type 'Array'
答案 0 :(得分:8)
只需删除: Array
部分:
var arrOfRewardDetail = [Dictionary<String, String>]()
编译器将推断出正确的类型,即[Dictionary<String, String>]
,而不只是Array
。