gpt4 book ai didi

ios - Swift 2.2 语法错误 : Cannot call value of non-function type 'UITableView!'

转载 作者:搜寻专家 更新时间:2023-10-31 22:32:26 25 4
gpt4 key购买 nike

我在 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)

关于ios - Swift 2.2 语法错误 : Cannot call value of non-function type 'UITableView!' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36835435/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com