Question

I am trying to forward a keyboard event from the Collection View to all the views it contains. I've tried figuring out how to obtain an array of the views so that I could forward the event to each view, but I could not find a way to do this. I feel that I am going about this the wrong way. Any direction is appreciated.

Thank you,

charlie

Was it helpful?

Solution

I think you're right (you're going about this the wrong way). Why short-circuit (or bludgeon) the event handling mechanism?

How about responding to the event on the view that receives it, then simply messaging all the other NSCollectionViewItems to respond as desired?

Or how about having the targeted item's view post a notification for which all collection view items listen? You could pass the targeted view as the notification object, then when handling the notification, ignore it if the notification object == self.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top