FROM : Jason Taylor
DATE : Mon Apr 18 20:13:30 2005
I am writing a program that has a table of items, each with a check box.
If the check box is checked off, the item is considered complete, like
an item of a todo list. The user has the option to hide checked off
items when displaying the table. My code is setup such that when a user
checks off an item, the object at the row that was checked off is set to
'completed'. When the table is reloaded, the items that are checked off
will not show up. In the tableView: objectValueForTableColumn:row
datasource method, I check each object of my data source array to see if
it is 'completed'. If it is not, I display it, otherwise I don't. The
problem is that once I hide an item, the row indexes of the table no
longer match the row indexes of my data source array (for instance
hiding the first item in the table with row index 0 will hide the object
in my data source array with index 0, this is fine, but when the table
is reloaded that first element of the data source array is not displayed
so the object at row index 0 in the table is actually the object at
index 1 in my array).
Is there a way to just hide a row in an NSTableView or will I have
to subclass it? Does anyone know of any code that does this so I can use
it as a reference?
Thanks,
Jason
DATE : Mon Apr 18 20:13:30 2005
I am writing a program that has a table of items, each with a check box.
If the check box is checked off, the item is considered complete, like
an item of a todo list. The user has the option to hide checked off
items when displaying the table. My code is setup such that when a user
checks off an item, the object at the row that was checked off is set to
'completed'. When the table is reloaded, the items that are checked off
will not show up. In the tableView: objectValueForTableColumn:row
datasource method, I check each object of my data source array to see if
it is 'completed'. If it is not, I display it, otherwise I don't. The
problem is that once I hide an item, the row indexes of the table no
longer match the row indexes of my data source array (for instance
hiding the first item in the table with row index 0 will hide the object
in my data source array with index 0, this is fine, but when the table
is reloaded that first element of the data source array is not displayed
so the object at row index 0 in the table is actually the object at
index 1 in my array).
Is there a way to just hide a row in an NSTableView or will I have
to subclass it? Does anyone know of any code that does this so I can use
it as a reference?
Thanks,
Jason
| Related mails | Author | Date |
|---|---|---|
| Jason Taylor | Apr 18, 20:13 | |
| Scott Stevenson | Apr 18, 22:43 | |
| Frank Midgley | Apr 18, 23:32 | |
| Jason Taylor | Apr 25, 01:33 |






Cocoa mail archive

