请针对此错误消息提供帮助:
这是我的代码:
func tableView(_ tableView: UITableView, cellForRowAt indePath: IndexPath) -> UITableViewCell {
// Parents
let cellIdentifierParents = "cell"
let CartCell: CartCell? = tableView.dequeueReusableCell(withIdentifier: cellIdentifierParents) as? CartCell
let cellObject = loadedCart[indePath.row]
CartCell?.selectionStyle = .none
CartCell?.lblItem.text = (cellObject as AnyObject).object(forKey: "item") as? String
CartCell?.lblSize.text = (cellObject as AnyObject).object(forKey: "size") as? String
CartCell?.lblPrice.text = ((cellObject as AnyObject).object(forKey: "price") as? String!)! + " €"
CartCell?.lblPrice.text = CartCell?.lblPrice.text?.replacingOccurrences(of: ".", with: ",")
var total = Float()
for item in loadedCart {
let price : NSString = ((item as AnyObject).object(forKey: "price") as? NSString)!
let priceTruncate = price.replacingOccurrences(of: "€", with: "")
let a:Float? = Float(priceTruncate)
total = total + a!
self.lblTotalOfCart.text = String(format : "SE: %.2f €",total)
self.lblTotalOfCart.text = self.lblTotalOfCart.text?.replacingOccurrences(of: ".", with: ",")
}
let deleteItem = UITapGestureRecognizer(target: self, action: #selector(self.deleteItem(_:)))
CartCell?.btnRemoveOutlet.addGestureRecognizer(deleteItem)
CartCell?.btnRemoveOutlet.isUserInteractionEnabled = true;
return CartCell!
}