NSTableView selected string

Discussion in 'Mac Programming' started by McBgnr, May 7, 2009.

  1. McBgnr macrumors regular

    Joined:
    Apr 13, 2009
    #1
    I am working on an App with NSTableView. I am having a button in this app and on the click of the button I want to know the string for the cell that has been selected in the NSTableView. How can I do this?
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You can get the selected row and column via the selectedRow and selectedColumn methods. You should then get the data from your model layer for this. You cannot ask the table for the "string" at this cell: what if it's not a string? An image, a custom cell, whatever? You need to think in MVC terms correctly: your data is in the model, the table view is a view. Get the data from the model.
     

Share This Page