1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Outlets for view contents in view-based tableview

Discussion in 'Mac Programming' started by Starfox, Feb 16, 2012.

  1. macrumors regular

    I have a view-based table view with a column view that has a bunch of buttons and textfields in it - I know how to respond to selectors sent by the buttons (by using rowForView:) but I have no idea as to how to get outlets or pointers to the objects I added to the view so I can set their values. I checked the WWDC video but it doesn't seem to cover this. Any ideas?
  2. macrumors 68000


    Learn how to fill a standard NSTableView with data, first. Learn how table view datasources and delegates perform the operations you need to fill the table. When you can write a simple or multi-column table view that does what you want, you will understand how to accomplish what you are asking for.

    Sorry that I am not being more helpful, but this is an important thing you need to learn on your own. I am just trying to point you in the right direction.
  3. macrumors regular

    I'm quite familiar with working with cell-based table views, data sources and delegates. Could you give me something more specific?
  4. macrumors 68000


    I assume you would be working with objects in a NSTableCellView, which responds to -subviews (being a NSView subclass), so you could use that to get objects by array index, but that would be pretty kludgy. I think I would be inclined to subclass NSTableCellView itself, with outlets in the cell view itself, connected to the objects it contains, and retrieve the objects you need with accessor methods in the subclass.

Share This Page