【发布时间】:2015-08-14 09:13:14
【问题描述】:
这个问题已经在 SO 上被问过几次了,但解决方案似乎总是在action 字符串的末尾添加:,或者添加一个发件人参数,如UIButton 或AnyObject,但这不适用于我。
这是我的代码:(在cellForRowAtIndexPath 函数内)
let mapsbut = cell.viewWithTag(912) as! UIButton
mapsbut.addTarget(self, action: "mapsHit:", forControlEvents: UIControlEvents.TouchUpInside)
func mapsHit(sender: UIButton!){
passBuild = buildings[indexPath.row]
performSegueWithIdentifier("mapSegue2", sender: self)
}
return cell
有什么想法吗?
【问题讨论】: