views:

44

answers:

1

Hi,

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

A: 

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.

Joshua Nozzi
Joshua, I can message all the NSCollectionViewItems, but I can only do it to the models. I cannot find a way to message the views for the models. Thank you for the reminder about notifications. I implemented it that way and it works wonderfully.
charlie hwang