简体   繁体   English

如何找到一个对象(控制器或视图)辞职的第一个响应者?

[英]How to find an Object (Controller or View) resigned first Responder?

I would like to do some cleanup activity when a particular object resigns the FirstResponder. 当特定对象重新启动FirstResponder时,我想做一些清理活动。 Is there any way to detect whether object has resigned first responder status. 有没有办法检测对象是否已重新响应第一响应者状态。

What methods I need to implement to know this? 我需要通过哪些方法来实现这一点? Any pointers for this? 有什么指针吗?

I already gone through this link. 我已经通过了这个链接。 But I did not get much out of it. 但是我并没有从中得到很多。

NSTableView & NSOutlineView editing on tab key 在Tab键上编辑NSTableView和NSOutlineView

According to Apples's NSResponder documentation you should override the resignFirstResponder method for you subclass. 根据Apples的NSResponder文档,您应该为您的子类覆盖resignFirstResponder方法。

Something like this: 像这样的东西:

- (BOOL)resignFirstResponder
{
    [super resignFirstResponder];
    /* Your cleanup code here */
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM