0
//This is in the UITableViewCell class method
class func videoCellWithTableView(tableview:UITableView) -> OLVideoCell{
var cell = tableview .dequeueReusableCellWithIdentifier("OLVideoCell") as! OLVideoCell
// “!cell” Why you will be prompted “ Unary operator '!' cannot be applied to an operand of type 'OLVideoCell'”
if !cell {
cell = OLVideoCell(style: .Default, reuseIdentifier: "OLVideoCell")
cell.selectionStyle = .None
}
return cell
}
。次のように条件を記述します: 'cell == nil'。 – werediver
ありがとうございます。「タイプの値 'OLVideoCellの値はゼロにはできません。比較は許可されません」というメッセージが表示されます。 –
強制的にセルを非オプションの型にキャストします。そこに 'nil'があると思うなら、オプションの型を使います。 – werediver