文件所有者 + 第一响应者 [英] File's Owner + First Responder

查看:35
本文介绍了文件所有者 + 第一响应者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 中的 File's Owner 和 First Responder Placeholder 究竟代表什么?

What exactly does the File's Owner and First Responder Placeholder in Xcode represent?

推荐答案

Files Owner 和 First Responder 是将在运行时存在的对象的代理.具体来说,Files Owner 表示将在方法 [NSBundle loadNibNamed: owner] 中为 owner 传入的对象.您可以通过属性信息面板"指定对象所有者的类型.指明文件所有者是什么后,您就可以与其建立连接.

Files Owner and First Responder are proxies for objects that will exist at runtime. Specifically, Files Owner represents the object which will be passed in for owner in the method [NSBundle loadNibNamed: owner]. You can specify, via the Attributes Info Panel, what kind of object owner will be. Once you've indicated what Files Owner is, you can make connections to it.

First Responder 是您通往 Responder Chain 的门户.您可以在文档窗口的类"选项卡中向第一响应者添加操作.接下来,将按钮和菜单项连接到 First Responder,以便它们调用所需的操作.响应者链中理解此操作的第一个对象将被调用.

First Responder is your portal to the Responder Chain. You can add Actions to First Responder in the "Classes" tab of the document window. Next, connect buttons and menu items to First Responder so that they call the desired action. The first object in the responder chain that understands this action will be called.

有关响应者链如何工作的更多信息,请参阅 Cocoa 文档.

See the Cocoa documentation for more information about how the responder chain works.

这篇关于文件所有者 + 第一响应者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆