sen*_*nty 0 uitableview didselectrowatindexpath nsindexpath ios swift
我有一个带静态单元格和节头的TableViewController.indexPath.row然而,我试着打电话,它们并不是唯一的......例如
TableView:
- Header 1
- Cell1 indexPath = 0
- Header 2
- Cell2 indexPath = 0
- Cell3 indexPath = 1
- Cell4 indexPath = 2
Run Code Online (Sandbox Code Playgroud)
获取行的唯一标识符的正确方法是什么?
因为使用这个使2个单元格具有相同的indexPath
override func tableView(tableView: UITableView, willSelectRowAtIndexPath indexPath: NSIndexPath) -> NSIndexPath? {
print(indexPath.row)
if indexPath.row != 0 {
return indexPath
}
return nil
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
165 次 |
| 最近记录: |