简体   繁体   English

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

[英]Swift 2.2 syntax error: Cannot call value of non-function type 'UITableView!'

I am using to Tab gesture in UITableView cell but following error occur. 我在UITableView单元格中使用Tab手势但发生以下错误。

"Cannot call value of non-function type 'UITableView!'" I am using the following code which I inherited from my previous Objective C project: “无法调用非函数类型的值'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){

        }
    }

I would appreciate if someone could help. 如果有人可以帮忙,我将不胜感激。

This line 这条线

self.tableView(forRowAtPoint:p)

is the source of problems. 是问题的根源。 You probably want self.tableView.indexPathForRowAtPoint(p) 你可能想要self.tableView.indexPathForRowAtPoint(p)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 快速错误:无法调用非函数类型“ SKSpriteNode”的值 - Swift error: Cannot call value of non-function type “SKSpriteNode” 错误:Swift 3上的“无法调用非函数类型的值” - Error: 'Cannot call value of non-function type' on Swift 3 无法调用非函数类型'UITableView的值 - Cannot call value of non-function type 'UITableView 无法调用非函数类型的值:UITableView - Cannot call value of non-function type: UITableView 在Xcode 8.3.2中的UI测试用例中,转换为当前快速语法“无法调用非函数类型'XCUIElement'的值”时出错 - Getting error while converting to current swift syntax “Cannot call value of non-function type 'XCUIElement'” in UI test cases in Xcode 8.3.2 在Swift 3中无法调用非函数类型'UICollectionView'的值 - Cannot Call Value of Non-Function Type 'UICollectionView' in Swift 3 ResponseSerializer'无法使用Swift 3调用非函数类型'NSHTTPURLResponse?'的值 - ResponseSerializer 'cannot call value of non-function type 'NSHTTPURLResponse?'' with Swift 3 无法调用非函数类型的值 '((AnyObject) -> AnyObject?)!' - 斯威夫特 3 - Cannot call value of non-function type '((AnyObject) -> AnyObject?)!' - Swift 3 无法在 Swift 中的 function 错误中调用非函数类型 'SwipeCard' 的值 - Cannot call value of non-function type 'SwipeCard' in the function error in Swift Swift 3-无法调用非函数类型'(response:Any,error Any)'的值 - Swift 3 - Cannot call value of non-function type '(response: Any, error Any)'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM