I would like my NSTableview-based view not to use previously created TableCellViews that scroll out of scope. I believe this is possible with a UITableView by overwriting dequeueReusableCellWithIdentifier: to return nil. Is there a similar solution for NSTableView?
-
My Background: I have a rather complicated view-tableView-based interface bound to ManagedObjects in the usual way (for example, table-content, -selection and -sortdescriptor are bound to an array controller, and tableCellView elements are bound to objectValue).
The table contains about 20 columns, but no more than 400 rows. Scrolling is very slow, but time profiling indicates that there is no single source of slowness (the largest single method call takes about 5% of the time). After caching the derived / user properties of my ManagedObject without significantly improving performance, I am now trying to cache the views (to avoid frequently overwriting tablecellViews when the view falls into scope).
What I'm trying at the moment is not to link the contents of the table, but to get my views using the NSDatasource protocol. there in
-(NSView*) tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
I would like to return cached TableCellViews if they exist. Otherwise, I create a new one using
[self.table makeViewWithIdentifier:... owner:self]
makeViewWithIdentifier , , .
...
-
, , .