Swift 不接受文本 属性?

Swift not accepting text property?

我正在使用 UITableView,但我在处理文本时遇到了一些问题 属性。我已经正确地声明了一切,我确信一切都是正确的。这是我的错误代码:

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell{
    let cell : UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "Test")
    cell.text = taskAdder.tasks[indexPath.row].name
    return cell
}

错误在线:

cell.text = taskAdder.tasks[indexPath.row].name

它说:

'text' is unavailable: APIs depreciated as of iOS 7 and earlier are unavailable in Swift.

我不确定此错误的含义或修复方法。

我们将不胜感激任何意见和建议。

提前致谢。

cell.text 自 iOS 7 起已弃用。 使用 cell.textLabel.text

查看更多信息: https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UITableViewCell_Class/index.html

错误说 "UITableViewCell"

上没有文本方法

你试过了吗"cell.textLabel",因为textLabel, detailTextLabel是用来在UITableViewCell中设置文本的