nsresponder

UIScrollView prevents touchesBegan, touchesMoved, touchesEnded on view controller

主宰稳场 提交于 2019-11-27 19:43:24
I am handling touches for a couple of my UI components in my view controller (custom subclass of UIViewController). It has methods touchesBegan:withEvent: , touchesMoved:withEvent: , and touchesEnded:withEvent: . It was working fine. Then I added a scroll view (UIScrollView) as the top view in the hierarchy. Now my touch handlers on the view controller don't work. They don't get called. The interesting thing is, I have various other UI components within the scroll view that do work. Some are buttons, some are custom views that define their own touchesBegan:withEvent: , etc. The only thing that

How to inspect the responder chain?

半城伤御伤魂 提交于 2019-11-27 01:07:09
问题 I'm doing some crazy multiple documents inside a single window stuff with the document-based architecture and I'm 95% done. I have this two-tier document architecture, where a parent document opens and configures the window, providing a list of "child" documents. When the user selects one of the children, that document is opened with the same window controller and it places a NSTextView in the window. The window controller's document association is changed so that the "edited dot" and the

How to add NSViewController to a responder chain?

雨燕双飞 提交于 2019-11-26 20:45:36
问题 I'm having hard time understanding and finding info about how to make NSViewController accept key and mouse events. I read somewhere that in order to register these events in NSViewController it should be added to a responder chain, but I can't find the answer how to properly do this. Any kind of help is highly appreciated! 回答1: There's a nice tutorial found at CocoaWithLove.com. Summed up: you'll create a subclass of NSView (e.g. "EugeneView") and then that subclass will have some extra