Swift 2.2 语法错误:无法调用非函数类型的值 'UITableView!'



我正在使用UITableView单元格中的Tab手势,但发生以下错误。

"无法调用非函数类型'UITableView'的值!我正在使用从以前的 Objective C 项目中继承的以下代码:

    var p: CGPoint = sender.locationInView(self.tableView)
    var indexPath: NSIndexPath = self.tableView(forRowAtPoint:p)
    var buttonTag: Int = indexPath.row
    var selectView = self.storyboard?.instantiateViewControllerWithIdentifier("DropDownSelectionViewController") as? DropDownSelectionViewController
    var selectWithNaviBar: UINavigationController = UINavigationController(rootViewController: selectView!)
    if (buttonTag == TEAM_ROW) {
        getPeoplesWithMenuType(TEAM)
    }else{
        if (buttonTag == OFFICES_ROW)  {
            selectView?.menuName = OFFICES_MENU
          //  selectView?.isMultipleSelection = yes
        }else if(buttonTag == CATEGORIES_ROW){
        }else if(buttonTag == INTERNAL_GROUPS_ROW){
        }
    }

如果有人能帮忙,我将不胜感激。

此行

self.tableView(forRowAtPoint:p)

是问题的根源。你可能想要self.tableView.indexPathForRowAtPoint(p)

最新更新