Я пытаюсь заполнить UITableView
, и я получаю сообщение об ошибке в последней части кода для одной строки.Заполнение UITableView
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath) as UITableViewCell
//ERROR IS IN THE LINE ABOVE ("anyobject" is not convertible to "UItableViewCell"
if (indexPath.section == 1) {
let (unit, availability) = myUnits[indexPath.row]
cell.textLabel?.text = unit
cell.detailTextLabel?.text = availability
} else {
let (assessment, mark) = myAssessments[indexPath.row]
cell.textLabel?.text = assessment
cell.detailTextLabel?.text = mark
}
return cell
}
Вы пропускаете восклицательный знак после 'как'. Голосование закрывается как опечатка. – dasblinkenlight