Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

aliher

macrumors newbie
Original poster
Mar 25, 2009
23
0
UK
Hi,

I have a separate panel displaying properies of selected row in NSTableView (there are quite a number of them so editing right in table doesn't look like a good idea).
I'm subscribing to notification for selection change and when I receive it, I set the objects to edit for the property editor. This works fine until I start selecting rows using keyboard. In this case I never get any notifications, but I can see that selected row changes as a result of keyboard commands (via debug button which dumps required properties of controls :).
What would be a right way to get notifications for that kind of selection changes? I can thing of subclassing NSTableView and handling keyboard events. Is there any other more elegant way?

UPD: NSTableView's and NSOutlineView's delegate provide functionality that supersedes one provided by notification and notifies on keyboard selection changes. I've missed it when reading docs.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
So were you subscribing manually to the notifications instead of using the delegate method that is handled automatically? It seems odd since it should work either way.
 

aliher

macrumors newbie
Original poster
Mar 25, 2009
23
0
UK
So were you subscribing manually to the notifications instead of using the delegate method that is handled automatically? It seems odd since it should work either way.

Exactly. I first used notifications as already subscribed to other events. Delegate description says something about its method being notified as a result of notification. But the behaviour seems to be different. As soon as I changed method name and set object as delegate it started receiving all notification. Sounds a bit illogical for me, but it works.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.