我想在 UITableViewCell 的 datailTextLabel 中设置一个值。如果代码运行,应用程序就会崩溃。
这是错误:fatal error: unexpectedly found nil while unwrapping an Optional value
这是发生错误的方法:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("Cell") as UITableViewCell
cell.detailTextLabel!.text = "Date" //error occurs
return cell
}
可能有用的信息: https ://www.dropbox.com/s/240sy3k1ic2hu0q/Bildschirmfoto%202015-02-28%20um%2021.03.35.png?dl=0