Tag: 可选绑定

条件绑定:如果让错误 – 条件绑定的初始化器必须有可选的types

我想从我的数据源和下面的代码行中删除一行: if let tv = tableView { 导致以下错误: 条件绑定的初始化程序必须具有可选types,而不是UITableView 以下是完整的代码: // Override to support editing the table view. func tableView(tableView: UITableView, commitEditingStyle editingStyle:UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) { if editingStyle == .Delete { // Delete the row from the data source if let tv = tableView { myData.removeAtIndex(indexPath.row) tv.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Fade) 我应该如何纠正以下? if let tv = […]