1
dequeReusableCellWithIdentifier
ожидает строку в качестве параметра. Но, когда я передаю строку, она показывает ошибку.Ячейка Tableview в swift
Код:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("CELL") as? UITableViewCell
if cell == nil {
cell = UITableViewCell(style: UITableViewCellStyle.Value1, reuseIdentifier: "CELL")
}
//we know that cell is not empty now so we use ! to force unwrapping
cell!.textLabel.text = "abc"
cell!.detailTextLabel.text = "1/2"
return cell }
Проблема:
Downcast от UITableViewCell? в UITableViewCell только разворачиваются параметры.
Вы можете сообщить об ошибке? – sasquatch