Re: Cocoa-dev Digest, Vol 14, Issue 7
Re: Cocoa-dev Digest, Vol 14, Issue 7
- Subject: Re: Cocoa-dev Digest, Vol 14, Issue 7
- From: Lorenzo Thurman <email@hidden>
- Date: Wed, 04 Jan 2017 16:42:32 -0600
> On Jan 4, 2017, at 2:00 PM, email@hidden wrote:
>
> Hi all
> I would like to get your experience of using tableViewSelectionDidChange notification of NSTableView. I have 2 table using in my application. When I click first table row, it is selected and row shown as blue. When I click second table row, first table row color becomes gray but still selected. When I select the same row (selected gray row) in first table, tableViewSelectionDidChange method is not called because it is the same row.
> What is the best way to get still notification to click the same row? Is it possible to use NSTableView action property using Selector? If so, is there any side effect of using the NSTableView#action?
> func onAction(sender : NSTAbleView){ //This is called irrespective of row is selected before or not
> }
What you have to do is when you get the didselect notification in the one table, you need to unselect from the other table. There are a couple of small issues with this still, and you lose the selection in the first table, if that matters. I'll send you a link to some old code where I had a similar issue. It's ObjC, but should be adaptable to Swift.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden