【发布时间】:2017-11-07 09:40:51
【问题描述】:
我收到以下错误:
1) 用于检查可选项的“UITableViewCell”类型的非可选表达式
2) 'UITableViewCell' 类型的值没有成员 'configureCell' 请
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if let cell:UITableViewCell = countryList.dequeueReusableCell(withIdentifier: "cell")! as UITableViewCell // Error 1 happens here {
let text: String!
if inSearchMode {
text = filteredCountriesList[indexPath.row]
} else {
text = countriesList[indexPath.row]
}
cell.congigureCell(text: text) // Error 2 happens here
return cell
} else {
return UITableViewCell()
}
}
【问题讨论】:
-
configureCell也许? -
如果有任何答案解决了您的问题,请接受该答案,以便以后的用户可以从中受益。
标签: ios swift compiler-errors