Ios 展开可选值时,客户单元格返回零

Ios 展开可选值时,客户单元格返回零,ios,uitableview,swift,Ios,Uitableview,Swift,我有一个自定义的表格视图单元格。在故事板中,我实现了一个ui标签和一个ui按钮。每次重复使用标签时,我想给它一个不同的值。故事板连接良好。如果我使用cell.textlab.text=eposodetitle,那就行了,但是如果我设置了UILabel的text属性,我就会得到错误 fatal error: unexpectedly found nil while unwrapping an Optional value 我试着注册了一个类,但没有成功。不知道该怎么办了。有很多类似的帖子,但都没

我有一个自定义的表格视图单元格。在故事板中,我实现了一个
ui标签
和一个
ui按钮
。每次重复使用标签时,我想给它一个不同的值。故事板连接良好。如果我使用
cell.textlab.text=eposodetitle
,那就行了,但是如果我设置了
UILabel
的text属性,我就会得到错误

fatal error: unexpectedly found nil while unwrapping an Optional value
我试着注册了一个类,但没有成功。不知道该怎么办了。有很多类似的帖子,但都没有帮助

这是我的
cellForRowAtIndexPath

   override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {

   //tableView.registerClass(episodeCell.self, forCellReuseIdentifier: "episode")
    var cell = tableView.dequeueReusableCellWithIdentifier("episode", forIndexPath: indexPath) as episodeCell

    cell = episodeCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "episode")

    let episode: MWFeedItem? = episodesToDisplay.objectAtIndex(indexPath.row) as? MWFeedItem
    if episode != nil {
        //process the episode
        var episodeTitle: NSString = episode?.title as String!
        //cell.textLabel.text = episodeTitle
       cell.episodeTitle.text = episodeTitle
    }

    return cell
}
这是我的定制手机:

class episodeCell: UITableViewCell {

var progress: Float?


@IBOutlet weak var episodeTitle: UILabel!

}
错误在这里:

var cell = tableView.dequeueReusableCellWithIdentifier("episode", forIndexPath: indexPath) as episodeCell

cell = episodeCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "episode")
将一个单元格出列并分配给
单元格
变量,然后用一个全新的实例替换该实例。删除此行:

cell = episodeCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "episode")