Re: NSTableView and row selection
Re: NSTableView and row selection
- Subject: Re: NSTableView and row selection
- From: Julien Palmas <email@hidden>
- Date: Thu, 31 Mar 2005 11:53:22 +0900
On Mar 31, 2005, at 11:30 AM, Julien Palmas wrote:
I am trying to achieve a certain behavior for my NSTableView, but I have some difficulties.
To illustrate what I want, let me give an example.
Imagine that my table view displays cars.
The car class contains the name of the car, and its color.
Let's say I have 3 red cars in my list
car A, car C, and car E.
when I clic on car A, I want all the red cars in the table view to get selected as well.
If I am not mistaken, I should only use a NSIndexSet to set the selection. This is not my tricky part.
Well, I thought this would not be that hard, but looks like I was wrong. If my tableView is not set to accept multiple selection in IB, the method [tableview
<x-tad-bigger>selectRowIndexes:] </x-tad-bigger>only selected the last index !!
This is not in accordance with the documentation !
[cite]
<x-tad-bigger>- (void)setAllowsMultipleSelection:(BOOL)</x-tad-bigger>flag
Controls whether the user can select more than one row or column at a time. If flag is <x-tad-bigger>YES</x-tad-bigger> the user can select multiple rows or columns; if flag is <x-tad-bigger>NO</x-tad-bigger> the user can’t. The default is <x-tad-bigger>NO</x-tad-bigger>. You can select multiple columns or rows programmatically regardless of this setting.
[/cite]
_______________________________________________
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