a) then you need a keyboard up too if someone navigates with the arrow keys. Some prefer this because when you change the selection in your code none of the both notifiations will be triggered
b) This is the standard method to get a notification every time the selection has changed.
c) Don’t see why should make a custom notification
What’s with the “workspaceClass’s”? There is no such thing. That’s what the error message is telling you – that NSWorkspace doesn’t know about “workspaceClass”. You should just remove that if you want to use this notification center.
However, you should be using NSNotificationCenter’s defaultCenter rather than the one in NSWorkspace if you are observing notifications sent within your app. The NSWorkspace one is to observe things that happen outside your app.
From the docs on NSWorkspace notifications:
So, if you want one of these, then use NSWorkspace, otherwise use NSNotification center.
That was my first idea: light and smart. but never fired.
I have waited for my NSArrayController to send this notification, not the table view. Now it works. In fact, it works too well: this notification is sent at each insertion as I fill the array. Is there a way to filter only selection change by mouse/key down? Maybe in the NSAppleEvent?
Regards,
PS. Thank you, Ric, for your precisions, as usual I keep every post preciously – one day or another I’ll surely come back to them.