> On 16 Mar 2015, at 12:24 pm, Patrick J. Collins > <patr...@collinatorstudios.com> wrote: > > The docs say that with a view based table, the subviews (i.e. columns) > should handle their own behavior, but-- how does a NSTextField (my cell > view) know what row it's in, what column it is, etc... ?
Each row view has a view controller with properties that tell it these things? The way I've done this in at least one project is to have a 'master' controller that maintains list (array) of 'row' controllers, one per table row view. These can usefully subclass NSViewController, since that's what they are. The position in the master's list is the same as the row index, so the master returns the view controller pertaining to the table's row as the "object" for that row, which in turn handles the controls and views of the table row. I haven't gone further to extend this to columns, as I have only used one-column tables, but there's no reason you couldn't, or handle multiple columns with a single controller, whichever makes most sense. --Graham _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com