From 1eed1901e958d9f2b0bbc7daaa5860c41ad1cd62 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Sat, 13 Feb 2010 22:33:36 -0800 Subject: [PATCH] Add some documentation to CPTableColum's setDataView: method. Closes #315. --- AppKit/CPTableColumn.j | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AppKit/CPTableColumn.j b/AppKit/CPTableColumn.j index c9957a907..706d59b80 100644 --- a/AppKit/CPTableColumn.j +++ b/AppKit/CPTableColumn.j @@ -229,6 +229,22 @@ CPTableColumnUserResizingMask = 1 << 1; return _headerView; } +/*! + This method set's the "prototype" view which will be used to create all table cells in this column. + + It creates a snapshot of aView, using keyed archiving, which is then copied over and over for each + individual cell that is shown. As a result, changes made after calling this method won't be reflected. + + Example: + + [tableColumn setDataView:someView]; // snapshot taken + [[tableColumn dataView] setSomething:x]; //won't work + + This doesn't work because the snapshot is taken before the new property is applied. Instead, do: + + [someView setSomething:x]; + [tableColumn setDataView:someView]; +*/ - (void)setDataView:(CPView)aView { if (_dataView === aView)