【发布时间】:2015-01-29 20:28:05
【问题描述】:
我当前的 swift 代码
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
cell.backgroundColor = UIColor.blackColor()
if let textLabel = cell.textLabel {
textLabel.textColor = UIColor.whiteColor()
textLabel.highlightedTextColor = textLabel.textColor
}
出现错误:第 3 行的“条件绑定中的绑定值必须是可选类型”:
if let textLabel = cell.textLabel {
提前致谢。
【问题讨论】:
-
也一直在尝试解决这个问题。