响应程序链的更改正在破坏我的撤消功能
我在 NSWindowDelegate 中为当前窗口设置了默认的 NSUndoManager,并且运行良好。但现在我修改了 NSOutlineView ,以便它的下一个响应者是它的视图控制器,如下所示:
[self.sceneOutlineView setNextResponder:self];
所以现在当大纲视图具有焦点时,我的响应者链似乎被破坏了,并且没有设置 NSUndoManager 供我的编辑菜单使用。
我是响应者链的菜鸟。我还需要做什么才能弄清楚如何让我的 undoManager 工作?
I have a default NSUndoManager set for the current window in my NSWindowDelegate, and that has been functioning great. But now I have modified an NSOutlineView so that its next responder is it's view controller like so:
[self.sceneOutlineView setNextResponder:self];
So now when the outline view has focus, something seems to be broken with my responder chain, and an NSUndoManager is not set for my Edit menu to use.
I'm a noob to the responder chain. What else do I need to do to figure out how to get my undoManager to work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试这样的操作,以完全修补响应者链:
Try something like this instead, to fully patch the responder chain: