【发布时间】:2016-03-15 13:12:07
【问题描述】:
如何解决这个错误?
带有getter/setter的变量不能有初始值
这是我的代码:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell: UITableViewCell = tableview.dequeueReusableCellWithIdentifier("cell") as UITableViewCell { //Error
cell.textLabel?.text = self.items[indexPath.row] //Error
return cell; //Error
}
}
【问题讨论】:
标签: swift initialization setter getter