无法将类型 'String' 的值分配给类型 'MyOrderTableViewCell'

Cannot assign value of type 'String' to type 'MyOrderTableViewCell'

我想点击基于 ID 的行,

所以我声明了一个数组来存储 ID:

var idenArr = [String]()  

关于 didSelectRowAt indexPath:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {

        var cell = tableView.dequeueReusableCell(withIdentifier: "myOrderTableViewCell", for: indexPath as IndexPath) as! MyOrderTableViewCell
        cell = idenArr[indexPath.row] `<-- Here show me this error "Cannot assign value of type 'String' to type 'MyOrderTableViewCell'"`
}

要获得它,您只需通过以下方式获得它:

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    let ID = idenArr[indexPath.row]
    print("Your selected Id is:" ID)
}