返回
使
你是谁
. 相反,您将另一个单元格出列并返回它,它没有您设置的任何属性。
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if let cell = tableView.dequeueReusableCell(withIdentifier: "myMessageCell", for: indexPath) as? myMessageCell {
cell.message = messages[indexPath.row]
cell.selectionStyle = .none
return cell // Return the cell here instead
}
// return tableView.dequeueReusableCell(withIdentifier: "myMessageCell", for: indexPath) // Return another cell which has none of your properties set.
return UITableViewCell() // return default cell in case your cell is not dequeued
}