Search code examples
swiftnstableview

Get the cell in a row and column (Cocoa)


I need to get the cell contained in a column at a specified row without using the tableview functions. For example:

for a in 0...tableview!.numberOfRows {
    let column = tableview.tableColumns[2]
    let cell = cell in column at the row a
}

Do you have any solutions?

EDIT: in Cocoa


Solution

  • I solved with this (to retrieve the values of an item in each cell), thanks Willeke

    for a in 0...tableview!.numberOfRows-1 {
         let cell = tableview.view(atColumn: 2, row: a, makeIfNecessary: false) as? cella
         print(cell?.tipo.title)
    }