【发布时间】:2015-12-24 06:15:25
【问题描述】:
我的表格视图正在填充,但单元格上没有内容
当我试图把这条线//cell.textLabel?.text = todoItems[indexPath.row]。我收到此错误check the error
// Cell creation
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! TableViewCell
cell.selectionStyle = .None
let item = todoItems[indexPath.row]
cell.delegate = self
cell.toDoItem = item
// modify the cell to have check mark
if (item.completed) {
cell.accessoryType = UITableViewCellAccessoryType.Checkmark
}
else {
cell.accessoryType = UITableViewCellAccessoryType.None
}
return cell
}
// Data source
class DataSource: NSObject {
let itenName: String
var completed : Bool
var deadline : NSDate
var UUID :String
init(itenName :String , completed :Bool = false , deadline : NSDate , UUID :String ) {
self.itenName = itenName
self.completed = completed
self.UUID = UUID
self.deadline = deadline
//self.subTitle = subTitle
}
}
【问题讨论】:
标签: ios arrays swift uitableview