的情况下有没有办法让在其中选择一排段的实例?有可能获得该部分的索引,所选单元格的索引,所选单元格的实例......但本节的实例?UITableView的didSelectRowAtIndexPath方法获得选择部分
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let indexPath = tableView.indexPathForSelectedRow // index path of selected cell
let headerCellIndex = indexPath!.section // index of selected section
let headerCellName = ????? // instance of selected section
let cellIndex = indexPath!.row // index of selected cell
let cellName = tableView.cellForRowAtIndexPath(indexPath!) // instance of selected cell
}
谢谢。
如何您插入节时的tableview负载的名字吗? – Lee
'字符串(内容[段] .sectionName)' 这也将在'didSelectRowAtIndexPath'-method..But工作是不是有办法让节的名称在某种程度上类似于你怎么弄的名称选中的单元格? – manu
是数组/对象的内容吗? – Lee