最佳答案
我正试图从我的数据源中删除一行代码和以下代码行:
if let tv = tableView {
导致以下错误:
条件绑定的初始化器必须具有可选类型,而不是 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 = tableView {