Skip navigation.
 
mlRe: two table view selection problem
FROM : Corbin Dunn
DATE : Tue Mar 04 18:10:29 2008

On Mar 4, 2008, at 8:28 AM, Stephane Sudre wrote:
>
> On 4 mars 08, at 17:14, Corbin Dunn wrote:
>

>>
>> On Mar 4, 2008, at 6:49 AM, Stéphane wrote:

>>>
>>> On Mar 4, 2008, at 3:35 PM, Nick Rogers wrote:
>>>

>>>> Hi,
>>>> I have two NSTableView in my app (tableView1 and tableView2).
>>>> If I select a row in tableView1 and then if I select a row in 
>>>> tableView2, I want the row in tableView1 to be deselected.
>>>> For this I'm using [tableView1 deselectAll: nil], but it leads to 
>>>> calling the delegate method again and leads to deselection of the 
>>>> selected row in tableView2 also.
>>>> So this way both table view's stands deselected.
>>>>
>>>> Is there a noble way to do it?

>>>
>>> I'm not sure it's noble since my blood is red but:
>>>

>>>> Listing:
>>>>
>>>> - (void)tableViewSelectionDidChange:(NSNotification *)notification
>>>> {
>>>>     if ([[notification object] isEqual: tableView1] == YES)
>>>>     {
>>>>         

>>>
>>>         if ([tableView1 numberOfSelectedRows]>0)
>>>         {

>>>>         [tableView2 deselectAll:nil];

>>
>> This will probably have the same problem; it will just stop after 
>> doing the callback twice.

>
> Hmm, it works fine on Panther as far as I can tell. Would the 
> notification mechanism have changed regarding this in later OS 
> versions?


I'm sure you will see the notification come through twice (once for 
each table). It just stops the recursion with the rows > 0 check. It 
works, but it is not the preferred solution.

corbin_______________________________________________

Cocoa-dev mailing list (<email_removed>)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>

This email sent to <email_removed>

Related mailsAuthorDate
mltwo table view selection problem Nick Rogers Mar 4, 15:35
mlRe: two table view selection problem Stéphane Mar 4, 15:49
mlRe: two table view selection problem Andy Lee Mar 4, 17:09
mlRe: two table view selection problem Corbin Dunn Mar 4, 17:14
mlRe: two table view selection problem Corbin Dunn Mar 4, 17:15
mlRe: two table view selection problem Stephane Sudre Mar 4, 17:28
mlRe: two table view selection problem Corbin Dunn Mar 4, 18:10