Questions tagged «optional-binding»

6
条件绑定:如果让出错-条件绑定的初始化程序必须具有Optional类型
我试图从数据源和以下代码行中删除一行: if let tv = tableView { 导致以下错误: 条件绑定的初始化程序必须具有Optional类型,而不是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) …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.