View Full Version : Outlets for view contents in view-based tableview
Feb 16, 2012, 07:19 PM
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?
Feb 16, 2012, 09:00 PM
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.
Feb 16, 2012, 09:03 PM
I'm quite familiar with working with cell-based table views, data sources and delegates. Could you give me something more specific?
Feb 16, 2012, 10:32 PM
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.