我有我正在设计的自定义单元格。自定义单元格标签
我想传递一个字符串,该自定义单元格。我做了所谓的AlarmCell(UITableCell的子类)可可触摸类,然后用这个代码(在我的UIViewController类),把它称为:
let myCell = AlarmCell()
然后从内AlarmCell叫的UILabel。
myCell.timeLabel?.text = newAlarm
newAlarm具有字符串 “下午8时38”
怎么会myCell.timelabel是走出来的零?我究竟做错了什么?
编辑:
AlarmCell类:
class AlarmCell: UITableViewCell {
@IBOutlet var timeLabel: UILabel!
}
报警(UIViewController类):
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let Cell = tableView.dequeueReusableCellWithIdentifier("alarmCell", forIndexPath: indexPath) as UITableViewCell
我:
cell.textLabel?.text = alarms[indexPath.row]
但我需要传递一个字符串到一个客户细胞内的汤姆LABL
你可以采取与CMD + SHIFT + 3 – 2014-11-03 02:51:14
连接是否正确网点截图?我们可以看到更多的'AlarmCell'类的代码和单元格的加载位置('tableView:cellForRowAtIndexPath:')吗? – 2014-11-03 02:53:55
IBOutlet字体是否有空圈? – Tinyfool 2014-11-03 03:15:13