1
我有tableview单元格中有一些自定义视图。当触摸自定义视图时,我需要存储触摸视图所在单元格的indexPath.row。这是我当前如何获取indexPath:indexPathForRowAtPoint.row对于tableView中的每个单元格总是返回零
@IBAction func bulletGroupPressed(sender: AnyObject) {
let center = sender.center as CGPoint
let indexPath = self.exercisesTableView.indexPathForRowAtPoint(center)!
self.exercisesTableView.selectRowAtIndexPath(indexPath, animated: false, scrollPosition: UITableViewScrollPosition.None)
println(indexPath.row)
}
我怀疑它做的!
上indexPath线,但我不知道它到底是什么。为什么indexPath.row总是在每个单元上给我零?
就是这样!谢谢!! – 2015-01-21 00:29:15