在我的swift应用程序中,我使用的是表视图。选择时,我只能更改单元格的背景色。但是,在牢房里,我有标签。选定单元格时无法更改标签的颜色。如果我为UITableViewCell创建实例,“接收致命错误”
我的编码在下面。请引导我。如何访问该标签?
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
var cell = tableView.cellForRowAtIndexPath(indexPath)
cell?.contentView.backgroundColor = UIColor.orangeColor()
var cell_prop = list_dip_tableView() //Creating instance
cell_prop.list_label.text.backgroundColor = UIColor.whiteColor()
//ERROR: fatal error: unexpectedly found nil while unwrapping an Optional value
}