0
我想獲取表格視圖單元格上的文本,然後獲取它在數組中的索引。解開UITableView單元格文本
這是我使用的代碼:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as UITableViewCell
let indexOfCellString = event.index(of: cell.textLabel!.text)
}
,但我得到了以下錯誤:可選字符串類型
- 價值?
這到底是怎麼回事不解開