Re: Hiding Rows in NSTableView
Re: Hiding Rows in NSTableView
- Subject: Re: Hiding Rows in NSTableView
- From: Jason Taylor <email@hidden>
- Date: Sun, 24 Apr 2005 19:33:54 -0400
Thanks a bunch. This worked great!
Once a table view has asked how many rows are in the table then that
is how many rows will be displayed. It assumes there is a one-to-one
mapping between the rows and the entries in the data source.
Two options:
1. Make your data source methods smart enough to hide the hidden
rows. For example, the tableView:objectValueForTableColumn:row can't
just get the object at the specified row index from the data source.
It will have to manually walk through the array (or whatever it is)
and count how many visible items it comes across. Since the data
source methods get called a lot, a faster implementation that
pre-calculated the row index to array index mapping for all possible
rows would be much better.
2. Only include the visible rows in your data source. When the user
chooses to only show the uncompleted items then remove the completed
ones from the data source and store them in a separate container
(array, dictionary, whatever). Replace them when the user toggles the
setting back. Far simpler coding then the previous option.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden